Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Server will not shutdown or log off

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2008
Glenn Hayes
 
Posts: n/a
Server will not shutdown or log off

W2k3 R2 sp2 will not respond to a log off or shutdown command. Nothing
unusual logged in the event log. Removed APC UPS software to eliminate that
possiblity. Can't seem to find anything that is not right but it is slow to
respond and no response on shutdown, restart or logoff. Server is a Dell 2850
Dual proc server.
--
Glenn Hayes

Reply With Quote
  #2  
Old 08-05-2008
Paul Bergson [MVP-DS]
 
Posts: n/a
Re: Server will not shutdown or log off

Have had issues such as this in the past on our Dell's (Don't think it is
Dell related though). We would issue remote shutdown commands and sometimes
the system wouldn't completely shutdown and it went into the undead state.
Anyone connected to the machine still worked but no new connections allowed
and no access to the console. Found out from Microsoft the shutdown command
isn't the greatest and so I wrote a VBScript that has resolved the issue.

This isn't the greatest code in the world, I should correct it so the values
are all defined in the variables section but use it if you find value to it.


Option Explicit

''''''''''''''''''''''''''''''''''''''''''''''''''

' Program - RemoteReboot.vbs '

' Author - Paul Bergson '

' Date Written - 08/15/07 '

' Description - Is a more drastic remote reboot '

''''''''''''''''''''''''''''''''''''''''''''''''''

Dim OpSysSet

Dim OpSys

Dim strComputer

Dim iMsg

Dim iConf

Dim Flds

Dim strSubject

Dim strHTML

on error resume next

strComputer = WScript.Arguments.Item(0) 'Get server name

If WScript.Arguments.Count = 1 Then

Set OpSysSet = GetObject("winmgmts:{(Shutdown)}\\" _

& strComputer _

& "\root\cimv2").ExecQuery("select * from Win32_OperatingSystem where
Primary=true")

For Each OpSys in OpSysSet

OpSys.Reboot()

Next

Else

Wscript.Echo "Server Name required. Reboot operation Aborted!"

Wscript.Quit

End If


'Send out an e-mail on the reboot

set imsg = createobject("cdo.message")

set iconf = createobject("cdo.configuration")

Set Flds = iConf.Fields

With Flds

..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"Yoursmtp.YourDomain.com"

..Update

End With

strHTML = strComputer & " has been automatically rebooted by YourServerName"
_

& " on " & FormatDateTime(Date(),1) & ", " & FormatDateTime(Time(),3)

strSubject = strComputer & " has been rebooted"

With iMsg

Set .Configuration = iConf

..To = "Notification Email@YourDomain.com" ' Destination e-mail address

..From = "ServerName@YourDomain.com"

..Subject = strSubject

..HTMLBody = strHTML

..Send

End With

set imsg = Nothing

set iconf = Nothing


--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.

"Glenn Hayes" <GlennHayes@discussions.microsoft.com> wrote in message
news:C2A1A98A-CD52-443B-B7BE-422EAA5225C1@microsoft.com...
> W2k3 R2 sp2 will not respond to a log off or shutdown command. Nothing
> unusual logged in the event log. Removed APC UPS software to eliminate
> that
> possiblity. Can't seem to find anything that is not right but it is slow
> to
> respond and no response on shutdown, restart or logoff. Server is a Dell
> 2850
> Dual proc server.
> --
> Glenn Hayes



Reply With Quote
  #3  
Old 09-05-2008
Glenn Hayes
 
Posts: n/a
Re: Server will not shutdown or log off

Good Idea just having compile errors with the script arount the Set OpSysSet
= GetObject("winmgmts:{(Shutdown)}\\" _ line.
Working my way throough the script to see if can make it work.
--
Glenn Hayes


"Paul Bergson [MVP-DS]" wrote:

> Have had issues such as this in the past on our Dell's (Don't think it is
> Dell related though). We would issue remote shutdown commands and sometimes
> the system wouldn't completely shutdown and it went into the undead state.
> Anyone connected to the machine still worked but no new connections allowed
> and no access to the console. Found out from Microsoft the shutdown command
> isn't the greatest and so I wrote a VBScript that has resolved the issue.
>
> This isn't the greatest code in the world, I should correct it so the values
> are all defined in the variables section but use it if you find value to it.
>
>
> Option Explicit
>
> ''''''''''''''''''''''''''''''''''''''''''''''''''
>
> ' Program - RemoteReboot.vbs '
>
> ' Author - Paul Bergson '
>
> ' Date Written - 08/15/07 '
>
> ' Description - Is a more drastic remote reboot '
>
> ''''''''''''''''''''''''''''''''''''''''''''''''''
>
> Dim OpSysSet
>
> Dim OpSys
>
> Dim strComputer
>
> Dim iMsg
>
> Dim iConf
>
> Dim Flds
>
> Dim strSubject
>
> Dim strHTML
>
> on error resume next
>
> strComputer = WScript.Arguments.Item(0) 'Get server name
>
> If WScript.Arguments.Count = 1 Then
>
> Set OpSysSet = GetObject("winmgmts:{(Shutdown)}\\" _
>
> & strComputer _
>
> & "\root\cimv2").ExecQuery("select * from Win32_OperatingSystem where
> Primary=true")
>
> For Each OpSys in OpSysSet
>
> OpSys.Reboot()
>
> Next
>
> Else
>
> Wscript.Echo "Server Name required. Reboot operation Aborted!"
>
> Wscript.Quit
>
> End If
>
>
> 'Send out an e-mail on the reboot
>
> set imsg = createobject("cdo.message")
>
> set iconf = createobject("cdo.configuration")
>
> Set Flds = iConf.Fields
>
> With Flds
>
> ..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
>
> ..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
> "Yoursmtp.YourDomain.com"
>
> ..Update
>
> End With
>
> strHTML = strComputer & " has been automatically rebooted by YourServerName"
> _
>
> & " on " & FormatDateTime(Date(),1) & ", " & FormatDateTime(Time(),3)
>
> strSubject = strComputer & " has been rebooted"
>
> With iMsg
>
> Set .Configuration = iConf
>
> ..To = "Notification Email@YourDomain.com" ' Destination e-mail address
>
> ..From = "ServerName@YourDomain.com"
>
> ..Subject = strSubject
>
> ..HTMLBody = strHTML
>
> ..Send
>
> End With
>
> set imsg = Nothing
>
> set iconf = Nothing
>
>
> --
> Paul Bergson
> MVP - Directory Services
> MCTS, MCT, MCSE, MCSA, Security+, BS CSci
> 2008, 2003, 2000 (Early Achiever), NT4
>
> http://www.pbbergs.com
>
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Glenn Hayes" <GlennHayes@discussions.microsoft.com> wrote in message
> news:C2A1A98A-CD52-443B-B7BE-422EAA5225C1@microsoft.com...
> > W2k3 R2 sp2 will not respond to a log off or shutdown command. Nothing
> > unusual logged in the event log. Removed APC UPS software to eliminate
> > that
> > possiblity. Can't seem to find anything that is not right but it is slow
> > to
> > respond and no response on shutdown, restart or logoff. Server is a Dell
> > 2850
> > Dual proc server.
> > --
> > Glenn Hayes

>
>
>

Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Server will not shutdown or log off"
Thread Thread Starter Forum Replies Last Post
Server 2003 Unexpected Shutdown imnotorginal Operating Systems 1 10-05-2010 11:54 PM
DDE server window problem at shutdown Mind It Operating Systems 3 26-09-2009 10:54 AM
How to boot and shutdown a system via server Brendan18 Networking & Security 3 10-07-2009 05:58 PM
Shutdown a server using the power button Artificer Windows Server Help 7 27-08-2008 11:56 PM
Windows 2003 Server Unexpected Shutdown jlm Windows Server Help 4 01-03-2007 02:57 PM


All times are GMT +5.5. The time now is 04:56 AM.