General discussion

  • Creator
    Topic
  • #2194478

    script for shutting down clients Pc.

    Locked

    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

All Comments

  • Author
    Replies
    • #3085931

      Reply To: script for shutting down clients Pc.

      by 3xp3rt ·

      In reply to script for shutting down clients Pc.

      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.

    • #2535856

      Thanks For your Tips

      by nishad ·

      In reply to script for shutting down clients Pc.

      Great!!
      Script working fine! keep doing good

      Thanks,
      Nishad

Viewing 1 reply thread