locked
WMI "Privilege not held" error when attempting to remote shutdown a machine RRS feed

  • Question

  • I have some code that attempts to shutdown a remote Vista (home) machine from an XP machine in a workgroup. The code sets ConnectionOptions username/password Impersonate etc

    It then utilizes 
    ManagementObjectSearcher to get access to win32_OperatingSystem. It all works correctly and I can list the properties (machine name etc) of the remote machine from the instance returned. However, when I try and invoke the Win32Shutdown method I get an exception "Privilege not held"

    I can't find a way to request the privilege or add it to the remote user. I can see in the Vista security event log that access is being denied because the remote credentials aren't being used. In other words I can see the login request for my remote user for the other operations but when shutdown is called those credentials are no longer present.

    Monday, July 21, 2008 4:57 AM

Answers

  • Hi!

    Seems like there's a bug in Windows that doesn't let you call the shutdown API function. A workaround would be to use this.
    Also, read the thread here: http://bytes.com/forum/thread269280.html. It's on the same issue.

    Regards,
    Lucian Baciu, MCTS, http://studentclub.ro/lucians_weblog
    • Marked as answer by Zhi-Xin Ye Friday, July 25, 2008 11:09 AM
    Tuesday, July 22, 2008 8:02 AM