Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 2000 Shutdown Issue 1

Status
Not open for further replies.
Nov 19, 2003
13
GB
Guys,

I'm a network administrator for a 45 machine network which runs NT4 SP6 Server and Windows 2000 Pro/XP Pro workstations.

Recently a number of machines have developed problems during shutdown. More specifically, when logging off, the PC hangs on Closing network Connections and will not go any further, forcing the users to switch the machine manually. The problem is intermittent and seems worse on some machines than others.

I have done some investigating myself into what connection the machine is failing to close, but can't establish which one - there are usually two at least, one to the mail server and one to the file server. My guess is that one of these TCP connections is failing to close properly, probably somewhere around the CLOSE-WAIT or CLOSE state - wether it isn't sending it's request to the server or wether the server isn't responding I'm not sure.

Any ideas?

Mark Holmes


 
Create a desktop shortcut for Shutdown containing:

C:\WINNT\SYSTEM32\TSSHUTDN.EXE 0 /DELAY:20 /POWERDOWN

 
Thanks for that bcaster. Unfortunatley I'm guessing that forces a power off after at 20 second delay, which won't solve the problem - the users at the moment wait two minutes and then power off manually by holding down power for 5 seconds. This causes problems with corrupt files etc which in turn is creating other issues.

I think need to find out how I can force all the network connections to close.

Thanks for the info though it will no doubt come in useful.

Mark
 
Isn't TSSHUTDN used for closing down Terminal Server sessions? Also users need to be members of the administrators group to run this command (although that can most likely be worked around).

 
I think tsshutdn is for closing terminal Server sessions, and users need admin level privledges to run it.
 
A1. If you do not specify a remote TS server, it acts to shutdown the local console workstation. So, no, it is not just for TS servers.

A2. You only need admin rights to shutdown a TS server.
 
Thanks for that bcastner. However tsshutdn.exe isn't in the \system32 dir. I think Terminal Server must be an additional component which hasn't been installed on the machines?

You input is appreciated thanks for your effort.

 
tsshutdn.exe is native to Win2k and xp.

Start, run, CMD

tsshutdn /?

Does not a help file appear?


 
tsshutdn.exe isn't on my system - I think it might because because terminal services isn't installed.

 
Not sure why it is not on your system, it should be there whether the TS client was installed or not.

So, write your own:

Using VBScript/WMI works very well, put the following code into a file called e.g. shutdwn.vbs, run it with wscript.exe <path-to-vbs-file>:

******** start of shutdwn.vbs

' use &quot;.&quot; for local computer
' Use &quot;PowerOff_Force&quot; for a forced poweroff

ShutDown &quot;.&quot;, &quot;PowerOff&quot;


Sub ShutDown(sNode, sAction)

Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8

Set oWMI = GetObject(&quot;winmgmts:&quot; _
& &quot;{impersonationLevel=impersonate,(Shutdown)}!\\&quot; _
& sNode & &quot;\root\cimv2&quot;)

Set colOperatingSystems = oWMI.ExecQuery _
(&quot;Select * from Win32_OperatingSystem&quot;)
For Each obj in colOperatingSystems
Set oOS = obj : Exit For
Next

sAction = LCase(sAction)

Select Case sAction
Case &quot;logoff&quot;
iCmd = EWX_LOGOFF
Case &quot;logoff_force&quot;
iCmd = EWX_LOGOFF + EWX_FORCE
Case &quot;shutdown&quot;
iCmd = EWX_SHUTDOWN
Case &quot;shutdown_force&quot;
iCmd = EWX_SHUTDOWN + EWX_FORCE
Case &quot;reboot&quot;
iCmd = EWX_REBOOT
Case &quot;reboot_force&quot;
iCmd = EWX_REBOOT + EWX_FORCE
Case &quot;poweroff&quot;
iCmd = EWX_POWEROFF
Case &quot;poweroff_force&quot;
iCmd = EWX_POWEROFF + EWX_FORCE
Case Else
' Default value
iCmd = EWX_POWEROFF
End Select

oOS.Win32shutdown iCmd
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top