Which is the best and sure way to shutdown systems
-
Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") For Each oOperatingSystem In oOS oOperatingSystem.Win32Shutdown(nForcePowerDown) Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks
reman
-
Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") For Each oOperatingSystem In oOS oOperatingSystem.Win32Shutdown(nForcePowerDown) Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks
reman
Let's just assume that your reasons for wanting to do this are entirely legitimate. Think about it, if it were possible to just shut down a remote system, without admin privileges, what would keep hackers from doing so?
My advice is free, and you may get what you paid for.
-
Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") For Each oOperatingSystem In oOS oOperatingSystem.Win32Shutdown(nForcePowerDown) Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks
reman
If you want to do remote shutdown, you need Admin privileges on the remote machine to do it. There is no way around it, for obvious reasons.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...