Open-AudIT

What's on your network?
It is currently Wed Apr 25, 2018 10:29 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 17 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Jul 21, 2007 5:02 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I've made some changes to audit.vbs that allow all options listed in audit.config to be used as command line options. Audit.vbs first reads the audit.config file then overwrites the variables with those passed on the command line

Replace the existing argument code:

Code:
' If any command line args given - use the first one as strComputer
If Wscript.Arguments.Count > 0 Then
strComputer = wscript.arguments(0)
end if
If Wscript.Arguments.Count > 1 Then
strUser = wscript.arguments(1)
end if
If Wscript.Arguments.Count > 2 Then
strPass = wscript.arguments(2)
end if


With this code:

Code:
' Parse the arguments using Split function
For Each sArg In Wscript.Arguments
    a = Split(sArg, "=", 2)
    sName = a(0)
    If UBound(a) >= 1 Then
        sValue = a(1)
   ExecuteGlobal sName & "=" & "sValue"
    Else
        sValue = ""
    End If
Next


Then replace:

Code:
command1 = "cscript " & script_name & " " & comparray(i)


With :

Code:
command1 = "cscript " & script_name & " " & "strComputer=" & comparray(i)


And Replace this:
Code:
command1 = "cscript " & script_name & " " & comparray(i) & " " & userarray(i) & " " & passarray(i)


With this:
Code:
command1 = "cscript " & script_name & " " & "strComputer=" & comparray(i) & " " & "strUser=" & userarray(i) & " " & "strPass=" & passarray(i)


With these changes you can run audit.vbs and pass the computer name, username and password as well as all other options available in audit.config. For example:

cscript audit.vbs audit_location="r" non_ie_page="http://inv/admin_pc_add_2.php" strcomputer="." audit_local_domain="n" verbose="n"

cscript audit.vbs strComputer="Computer1" strUser="Username1" strPass="password"

cscript audit.vbs audit_location="r" non_ie_page="http://inv/admin_pc_add_2.php" input_file="input.txt" strcomputer=""


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 14, 2007 7:42 am 
Offline
Helper

Joined: Sat Sep 17, 2005 7:15 am
Posts: 71
I've updated my audit.vbs to work with the newest version of Open-Audit (as of 10/12/07).

I've left most code intact, but have changed the command line switches as my modifications will allow you to use the switches in any order. Did not add the above command line switches though (the ones that replace the audit.config variables)...

See my previous post with the link in it.

Seems to be working OK so far.

Rob

_________________
Server Info:
OS : Windows Server 2003
Auditing: ~300 machines
LDAP: Windows Server 2003 Active Directory


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group