This one only took me a couple of minutes to debug, but it gave me a laugh.
Watcha Doin’ BRUCE ?
I was using the following command from within Powershell to reboot my favourite server, BRUCE
$server = get-wmiobject -computer BRUCE -class Win32_OperatingSystem
This error had me briefly puzzled because I KNEW that the Powershell account making the WMI call had admin privileges on BRUCE.
Then I realised that the script itself was running on BRUCE. i.e. I was running a script that was trying to shut down the server on which it was running. This may not be advisable.
So I ran the script on a different server, NARELLE, and tried to reboot BRUCE from there. Surprise, surprise it worked.
In summary, you will get Privilege Not Held from Powershell WMI if you try to reboot a server on which your script/WMI call is executing. Run your script on a different machine and try again.
Other Things To Avoid
– Sawing off a branch while sitting on it.
– Smashing yourself over the head with a Fire Extinguisher.