Discussion:
------- PsShutdown -----
(too old to reply)
WildPacket
2009-12-15 13:38:01 UTC
Permalink
Trying to force a reboot domain wide for about 2000 XPP PCs using the
following ...http://technet.microsoft.com/en-ca/sysinternals/bb897541.aspx

Using the Domain Admin Account from a DC running Windows 2003 64Bit SP2


Keep getting this error message

Couldn't access PCXXXXXX:
The network path was not found.

Make sure that the default admin$ share is enabled on PCXXXXXX.

If PCXXXXXX is already performing a shutdown operation you must
abort it before issuing a different command.

I can ping the PC. I have imported all computers into a TXT file and running
the command against that file. From 2000 PCs only 15/20 got rebooted.

I have noticed other people also posted the similar issue but no solid
solution.

Advise Please.

Thank you
Paul Bergson [MVP-DS]
2009-12-15 14:17:08 UTC
Permalink
The only way we have successfully had reboots work consistently is with the
code below. Put it into a script and pass a value to it, the value is the
server to reboot. I have no experience with psshutdown. I have built in
e-mail out put that I haven't included so you can remove the unused
variables in the code below.

To call the script below:
cscript your_script.vbs servername

If you are seriously rebooting 2000 machines all at once you are doing your
enterprise a big disservice. You are going to pummel every network device,
etc... This is an EXTREMELY BAD IDEA!!!

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
--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

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.
Post by WildPacket
Trying to force a reboot domain wide for about 2000 XPP PCs using the
following ...http://technet.microsoft.com/en-ca/sysinternals/bb897541.aspx
Using the Domain Admin Account from a DC running Windows 2003 64Bit SP2
Keep getting this error message
The network path was not found.
Make sure that the default admin$ share is enabled on PCXXXXXX.
If PCXXXXXX is already performing a shutdown operation you must
abort it before issuing a different command.
I can ping the PC. I have imported all computers into a TXT file and running
the command against that file. From 2000 PCs only 15/20 got rebooted.
I have noticed other people also posted the similar issue but no solid
solution.
Advise Please.
Thank you
WildPacket
2009-12-15 17:49:02 UTC
Permalink
Thanks Paul.

I fire a reboot at 1:00 am once a month.
Post by Paul Bergson [MVP-DS]
The only way we have successfully had reboots work consistently is with the
code below. Put it into a script and pass a value to it, the value is the
server to reboot. I have no experience with psshutdown. I have built in
e-mail out put that I haven't included so you can remove the unused
variables in the code below.
cscript your_script.vbs servername
If you are seriously rebooting 2000 machines all at once you are doing your
enterprise a big disservice. You are going to pummel every network device,
etc... This is an EXTREMELY BAD IDEA!!!
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
--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009
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.
Post by WildPacket
Trying to force a reboot domain wide for about 2000 XPP PCs using the
following ...http://technet.microsoft.com/en-ca/sysinternals/bb897541.aspx
Using the Domain Admin Account from a DC running Windows 2003 64Bit SP2
Keep getting this error message
The network path was not found.
Make sure that the default admin$ share is enabled on PCXXXXXX.
If PCXXXXXX is already performing a shutdown operation you must
abort it before issuing a different command.
I can ping the PC. I have imported all computers into a TXT file and running
the command against that file. From 2000 PCs only 15/20 got rebooted.
I have noticed other people also posted the similar issue but no solid
solution.
Advise Please.
Thank you
.
Eric Westfall
2009-12-15 14:39:03 UTC
Permalink
Not sure why psshutdown would return that error on so many of your computers.
Have you tried running native commands to see if they work where psshutdown
does not?

shutdown /m \\hostname /r /f /t 00

I would also make sure that you are able to attach to the admin$ share on
some of the computers that are returning the error:

net use \\hostname\admin$

If that works you could write a PowerShell script to iterate through a file
and call a remote shutdown command. This can also be accomplished using a
VBScript as well, I've attached an example script that uses standard WMI
classes to restart a list of computers in a file.

Option Explicit
On Error Resume Next

Dim objFSO, objSourceFile
Dim colNamedArguments
Dim strSourceFile

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colNamedArguments = WScript.Arguments.Named

If colNamedArguments.Exists("SourceFile") Then
strSourceFile = colNamedArguments.Item("SourceFile")
Else
strSourceFile = "C:\Restart-Hosts.txt"
End If

If objFSO.FileExists(strSourceFile) Then
Set objSourceFile = objFSO.OpenTextFile(strSourceFile, ForReading)

Do Until objSourceFile.AtEndOfStream
strComputer = objSourceFile.ReadLine

Call RestartComputer(strComputer)
Loop

objSourceFile.Close
Set objSourceFile = Nothing
End If

Public Function RestartComputer(strComputer)
' Function Description
'
' Restarts a specified computer.
'
' Parameters
'
' strComputer - Specifies the target computer to restart
'
' Return Value(s)
'
' None

Dim objWMIService, objOperatingSystem
Dim colOperatingSystem

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & _
"\root\cimv2")
Set colOperatingSystem = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")

For Each objOperatingSystem In colOperatingSystem
objOperatingSystem.Reboot
Next

Set colOperatingSystem = Nothing
Set objWMIService = Nothing
End Function
Post by WildPacket
Trying to force a reboot domain wide for about 2000 XPP PCs using the
following ...http://technet.microsoft.com/en-ca/sysinternals/bb897541.aspx
Using the Domain Admin Account from a DC running Windows 2003 64Bit SP2
Keep getting this error message
The network path was not found.
Make sure that the default admin$ share is enabled on PCXXXXXX.
If PCXXXXXX is already performing a shutdown operation you must
abort it before issuing a different command.
I can ping the PC. I have imported all computers into a TXT file and running
the command against that file. From 2000 PCs only 15/20 got rebooted.
I have noticed other people also posted the similar issue but no solid
solution.
Advise Please.
Thank you
Loading...