Open-AudIT

What's on your network?
It is currently Sat Apr 21, 2018 5:56 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: New Command Line Options
PostPosted: Fri Jul 06, 2007 4:49 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  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 3 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group