id="info"

General discussion

Locked

script for shutting down clients Pc.

By bharat_prasad1234 ·
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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by 3xp3rt In reply to script for shutting down ...

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.

Collapse -

Thanks For your Tips

by nishad In reply to script for shutting down ...

Great!!
Script working fine! keep doing good

Thanks,
Nishad

Back to Networks Forum
2 total posts (Page 1 of 1)  

Hardware Forums