windows远程批量关机

windows远程批量关机

开始->运行->gpedit.msc(组策略编辑器)->计算机配置->管理模块->系统,将“windows系统关闭发生后不关闭系统电源”设为开启状态,如果无该项,则进入注册表,进入

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT表项下,新建DWORD值,名称为"DontPowerOffAfterShutdown",值设为"1"

建批处理文件poweroff1.bat,内容如下:

net use \\10.10.10.10\ipc$ aaa /user:administrator && at \\10.55.10.10 %1 shutdown /s /f /m \\10.10.10.10

...

在cmd状态下运行 poweroff1 3:00 就可实现凌晨3点定时关机

立即关机poweroff2.bat的内容如下:

net use \\10.10.10.10\ipc$ aaa /user:administrator && shutdown /s /f /m

\\10.10.10.10

...

"10.10.10.10"为被关闭机器的ip,"aaa" 为被关闭机器的administrator的密码

对windows xp,需开启文件共享服务

中间经过防火墙、acl屏蔽的,需开防 source和dest 的139、445tcp端口及netbios udp 端口

for example:

若acl 为

rule 11 deny tcp source-port eq 139

rule 41 deny tcp destination-port eq 139

rule 19 deny tcp source-port eq 445

rule 49 deny tcp destination-port eq 445

rule 10 deny udp source-port eq netbios-dgm

rule 40 deny udp destination-port eq netbios-dgm

rule 8 deny udp source-port eq netbios-ns

rule 38 deny udp destination-port eq netbios-ns

rule 12 deny udp source-port eq netbios-ssn

rule 42 deny udp destination-port eq netbios-ssn

则应

undo packet-filter inbound ip-group base-traffic rule 11 undo packet-filter inbound ip-group base-traffic rule 41 undo packet-filter inbound ip-group base-traffic rule 19 undo packet-filter inbound ip-group base-traffic rule 49 undo packet-filter inbound ip-group base-traffic rule 10 undo packet-filter inbound ip-group base-traffic rule 40 undo packet-filter inbound ip-group base-traffic rule 8 undo packet-filter inbound ip-group base-traffic rule 38 undo packet-filter inbound ip-group base-traffic rule 12 undo packet-filter inbound ip-group base-traffic rule 42

相关文档