News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Miscellaneous Forum
 
WindowsController remote computer reboot

Reply

by Emanuel Dejanu [emanuel dot dejanu at humaninfo dot ro]
posted on 2010/08/04

Hi,

I have used your class to EnableToken(\"SeShutdownPrivilege\") so that I can call InitiateSystemShutdown function.

Can you add a new function like this to your class:

public static bool RemoteShutdown(string machineName = null, string message = \"Need to shutdown\", int timeout = 0, bool forceAppsClosed = true)
{
WindowsController.EnableToken(\"SeShutdownPrivilege\");
if (string.IsNullOrEmpty(machineName))
machineName = Environment.MachineName;
return InitiateSystemShutdown(machineName, message, timeout, forceAppsClosed, false);
}

public static bool RemoteReboot(string machineName = null, string message = \"Need to reboot\", int timeout = 0, bool forceAppsClosed = true)
{
EnableToken(\"SeShutdownPrivilege\");
if (string.IsNullOrEmpty(machineName))
machineName = Environment.MachineName;
return InitiateSystemShutdown(machineName, message, timeout, forceAppsClosed, true);
}

Thanks,

Emanuel

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.