Forum Discussion
36 minutes ago, IT GUY said:Thanks Eric that makes sense.
Also did you have any issues runnning the Set-WMINameSecurity powershell script as a scheduled task? Manuallly running the power shell commands it adds the correct wmi permission but it seems running from task schedule it doesn't do anything.
What I ended up doing was taking all the individual actions MS recommended in their task and add them into a single powershell script that i called without any parameters.
I called their script inside that script.
- For example, i created a folder using GPP on the local system called "remote wmi access"
- I then copied MS script "set-wmi....."
- I then copied custom script with the below commands in it to the same folder
- Finally, I had my schedule task call the custom script locally, so "powershell.exe -file "customscript.ps1"
. "c:\scripts\Remote WMI Access\Set-WMINameSpaceSecurity.ps1" -namespace root/cimv2 -account “domain\Group or user” -operation Add -permissions Enable
. "c:\scripts\Remote WMI Access\Set-WMINameSpaceSecurity.ps1" -namespace root/cimv2 -account “domain\Group or user”” -operation Add -permissions RemoteAccess
Restart-Service winmgmt -force
Related Content
- 6 months ago
- 9 months ago