twdeveloper
Programmer
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
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