Discussion Locked

script for shutting down clients Pc.

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

As all the client systems logon to server for file and printer sharing. Server is win2k advance server. Pl. provide me how to prepare a script to force the client systems to shutdown through server.

Thanx
Bharat Prasad

2 replies

by 3xp3rt

Cut n past this into notepad and save with the extension ".vbs".

strComputer = "atl-dc-01"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Shutdown(1)
Next

Replace strComputer with "." to reboot the machine on which you're running
the script, or the name/ip of the remote computer you want to shutdown.

This discussion is closed to new replies.