Log off a domain PC remotely.

 

Occasionally I run across a tip or script which is both simple and powerful. In this case it is also scary! Scary in as much as it’s potential for misuse. I will let you decide on whether to pass this one around to mid-managers or internal sub-administrators in your organisation ;)

-- Visual Basic script follows --

strComputer= "."

Set objWMI = GetObject("winmgmts:{(Shutdown)}\\" + strComputer + "\root\cimv2")

Set colOperatingSystems = objWMI.ExecQuery("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

ObjOperatingSystem.Win32Shutdown(0)

Next

-- Script Ends --

Posted on 7:57 AM by Nathan aka Mysteryn11 and filed under | 0 Comments »

0 comments: