Ask a Question related to ASP.NET General, Design and Development.
-
Ken Tucker #1
Re: Reboot remote server from ASP.NET (VB.NET) using WMI
Mickey,
There is a free class here to help you reboot the system.
[url]http://www.mentalis.org/soft/class.qpx?id=7[/url]
Ken
----------------
"Mickey Blue" <mblue@blue.com> wrote in message
news:Xns93AF7E5DCD921MBlue@206.127.4.10...> Hello All
>
> I'm attempting to use WMI to reboot a remote server from an ASP.NET page,
> however I'm clearly missing some key piece of knowledge. Can anybody
> please tell me what I'm doing wrong?
>
> Thanks in advance.
>
> Here's the relevant code:
>
> -------
>
> Private Sub btnBoot_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles btnBoot.Click
> 'Get name of computer to reboot
> '(List on the Web page named lstMemberList contains the names)
> Dim strComputer As String = lstMemberList.SelectedItem.Text
> 'WMI objects
> Dim objManScope As System.Management.ManagementScope
> Dim objQuery As System.Management.ObjectQuery
> Dim objSearcher As ManagementObjectSearcher
> Dim colQueryCollection As ManagementObjectCollection
> Dim outParams As ManagementBaseObject
> Dim colInstances As Collection
> Dim objInstance
> Dim strWQLQuery As String
> Dim intResult As Integer
> 'Build WQL string
> strWQLQuery = "SELECT * FROM Win32_OperatingSystem " & _
> "WHERE Primary = ""True"""
> 'Connect to WMI on remote computer
> objManScope = New System.Management.ManagementScope("\\" & _
> strComputer & "\root\cimv2")
> objQuery = New System.Management.ObjectQuery(strWQLQuery)
> objSearcher = New ManagementObjectSearcher(objManScope, objQuery)
> colQueryCollection = objSearcher.Get
> 'Reboot remote computer
> For Each objInstance In colQueryCollection
> 'intResult = objInstance.Win32Shutdown(6) '6 = ForcedReboot
> outParams = objInstance.InvokeMethod("Reboot", "", "")
> Next
> End Sub
>
> -------
Ken Tucker Guest
-
ADOBE: PLEASE REBOOT YOUR SERVER
HAVE YOU TESTED YOUR DOWNLOAD SERVER TODAY? -
Want to Reboot server from ASPX page
I am developing a asp.net web based service application for our product I am trying to trigger a reboot of the server based on a user request I... -
Remote System Reboot
We have an OS X server with Filemaker 6 Unlimited, Apache, and the Web Server Connecter. On occasion, Filemaker will crash. When this happens,... -
Remote reboot
The RS/6000 (don't remeber model now - rack mounted) can be rebooted successfuly from console. But every time after remote reboot is executed... -
Error Display during reboot the AIX server
25A80998 NVRAM RC script evaluation error - command line - execution error Execution of a command line within the nvram configuration variable...



Reply With Quote

