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!

Scripted XP reboot

Status
Not open for further replies.

finatic

Technical User
Jun 19, 2003
36
US
I want to write a script that I can send out to 50 pc's in my domain. None of the users have any rights on the PC's I have tried the shutdown command but it does not run when the users are logged on. Any help will be appreciated.

[ponder]
 
if all you are trying to do is write a script to reboot or shutdown those fifty machines, i dont understand what users have to do with it. If you have an account that has the right on each remote machines to reboot the wks, then you should be able to reboot them with the 'shutdown.exe' file. I use 'shutdown.exe' from the NT Resource kit, (I just like the syntax better than the newer versions, and I issue the command like such:

shutdown \\machine /Y /R /C

where /Y = Yes
where /R = Reboot
where /C = means automatical close any running applications

HTH - Please give more details
 
Well this is the issue. I have to send this script out to all the PC's and they are not in the same geographic area. They have to be able to reboot once a month with no user interaction whatsoever. The only account on these machines is the local administrator. I have used the AT command to schedule this but it does not run when the users are logged on. I am now trying the schtasks command to see if this works. Sorry that I did not make it more clear.
 
This is what I have so far.

at 02:00 every:Th shutdown -r -t 240 "This is a scheduled reboot"

This did not work It did schedule the task but it did not run until I logged onto one of the PC's and addedd the administrator password.

 
finatic

sorry i have not responded and tried to help more. i lost the post. guess you should always mark them. have u resolved this yet?
 
No I still did not resolve this yet. Am I correct that PSSHUTDOWN requires that you add software to the PC.
 
No, Now I know that you do not need psshutdown on all of the PC's. I am having a problem with the syntax.

psshutdown -r -t 120 -m "TEST" @PC.txt

Sorry im new to this........
Any help will be appreciated.

 
That looks about right to me, are you running psshutdown from a server using a bat file to schedule it?
 
Ran up on this late but...

You will also need to add -u (Username) -p (Password) of a user with administrative rights.

psshutdown.exe -r -t 120 -m "TEST" -u Administrator -p password @pc.txt


Make sure the pc.txt is in the same directory as psshutdown.exe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top