简体   繁体   English

关闭脚本命中不在列表中的计算机

[英]Shutdown script hits computer not in the list

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: 它使用pstools来实现psshutdown功能,这确实很简短:

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. 该计算机以前是Windows 7机器,名称类似于SMHSBIO,但现在是Windows 8机器,名称为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. 我检查了Active Directory,看是否有用于SMHSBIO的某种幽灵计算机,但没有骰子,它不在那儿。

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! 谢谢!

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.... 处理结果在您的域中更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM