LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

remote shutdown

Does anyone have any experience implementing a remote shutdown in CVI using WIn32 SDK calls?

InitiateSystemShutdown  should do it, but getting the remote system to accept the shutdown request might be a trick.    The SDK isn't very clear - I think what the SDK is saying is that the remote system must have the remoteshutdown capability both present for the remote user/group, AND it must be enabled as well.

I have local system shutdown working all OK by programatically enabling the shutdown priveledge SE_SHUTDOWN_NAME.

Do I enable it on the remote system the same way?

How do I set up a remote system to allow a remote shutdown?  Does it need to be tailored for every possible remote user that wants to initiate a remote shutdown shutdown?  I realize I need admin priveledege to enable it, but what do I do exactly to enable it?

Thanks for any help on this.

Menchar


Message Edited by menchar on 01-28-2008 10:10 AM
0 Kudos
Message 1 of 4
(3,208 Views)
To answer my own question, at least partly:

If calling program is running on the local system as a user that also has admin privileges on the remote system, the remote system will be shutdown.  Otherwise an acess denied error is returned(5).

It seems to me though that an admin on the remote system should be able to create the remote shutdown privilege for a specific user/group, even without that user/group having admin privileges.

In any event, I can remotely reboot the heck out of my laptop from my desktop machine 🙂

Menchar
0 Kudos
Message 2 of 4
(3,197 Views)
i don't know which version of Windows you are running, but Windows XP (and also 2000 i think) needs a special setup.

on windows XP professional: look in "control panels/administrative tools/local security policy". then, on the left pane, in "local policies/user rights assignment", adjust the settings for "shut down the system" and "force shutdown from a remote system". then in "local policies/security options", adjust the settings for "Shutdown: allow system to be shut down without having to log on".

also, on windows XP and above, there is a command line tool called "shutdown.exe" which, when used with the /m option, will allow you to perform a remote shutdown, provided said policies are setup correctly. this will allow you to test if you can perform a remote shutdown without having to write a whole lot of code. (on windows 2000, "shutdown.exe" can be downloaded with the administrative resource pack)
Message 3 of 4
(3,187 Views)
Thanks.

I had seen the privilege in the local security policy editor, but I was unsure exactly how to use it.  It looked to me as if I need to establish the privilege for specific users or groups, and then have the local process enable the privilege.

I was able to reboot my laptop remotely, but I have admin privilege on it under the user/group name I was using on my desktop machine. 

I see that on the laptop the remote shutdown is enabled for administrators, and that allow shutdown without logon is enabled.

I should be able to enable these for other users / groups I would think.

I had heard something about the shutdown.exe, thanks for clarifying it.

Menchar


0 Kudos
Message 4 of 4
(3,183 Views)