Shutdown script hits computer not in the list

276 views Asked by At

I have a shutdown list I've made that's supposed to read off a list of strings and shut down computers in this list. It uses pstools for the psshutdown feature, and it's really short:

cd "C:\Users\Administrator.<domain>\Desktop\Fun Stuff\PSTools"

psshutdown.exe @"C:\shutdownlist.txt" -t 600 -s -m "End of Day Shutdown."

When it runs, it does what it's supposed to : goes through that text file and shuts down all the appropriate computers, except for one - it shuts down a computer that is not actually on that list whenever it runs. The computer used to be a windows 7 machine with a name like SMHSBIO but now it's a windows 8 box with the name SABS9686. Neither of those names are on the list, but still are affected by this shutdown program.

I've done some tests, disabling the program and re-enabling it and sure enough the times the shutdown program was not active the computer stayed up, but as soon as it was put back in and ran that computer was shut down for some odd reason. I've checked Active Directory to see if maybe there was some kind of ghost computer for the SMHSBIO one but no dice, it wasn't there.

Not sure what's causing this program to strike at this computer, and it's a really strange oddity. If you have any insight, please share. Thanks!

1

There are 1 answers

0
Magoo On

Try

for /f "delims=" %%i in (C:\shutdownlist.txt) do (
 echo attempting to shutdown %%i
 psshutdown.exe \\%%i -t 600 -s -m "Test Shutdown."
 pause
)

Which should tell you which command is causing the problem. Dealing with the result is more in your domain....