Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with a Verification Script....

Status
Not open for further replies.

twdeveloper

Programmer
Mar 8, 2011
19
US
Hello,
I have developed a few Scripts that sets DCOM Permissions and SETS WMI Permissions.
It took me awhile but I eventually figured it out and these scripts work great.
Now I want to just do a general Verification Script that can be run and gather the information that was Set
so that I can have proof my "Set" Scripts worked Properly.

Looking for some assistance with this Script. Thank You.

Here is my script for getting DCOM Permissions and WMI Permissions (It uses the dcomperm tool to set DCOM Permissions and then calls two additional scripts that get the WMI Security Group Permissions for root/CIMV2 and root/Default):

Dim fso
Dim ws

set fso = createObject ("scripting.filesystemobject")
set ws = WScript.CreateObject("WScript.Shell")

thisFolder = Left ( WScript.ScriptFullName, Len(WScript.ScriptFullName) - Len(WScript.ScriptName) )
target = chr(34) & thisfolder & "dcomperm.exe" & " -ml set <fakeserviceaccount> permit level: ll,rl,la,ra,r"
ws.Run target, 1, True

script1 = ws.ExpandEnvironmentStrings("%WINDIR%") & "\system32\cscript.exe " & chr(34) & thisfolder & CIMV2Script.vbs" & Chr(34)
ws.Run script1, 1, True

script2 = ws.ExpandEnvironmentStrings("%WINDIR%") & "\system32\cscript.exe " & chr(34) & thisfolder & DEFAULT.vbs" & Chr(34)
ws.Run script2, 1, True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top