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=""