Forcing a remote logoff

How to force a user to log off of a remote machine

Bob logs onto his workstation and you (who are on another workstation) want to force Bob to log off. How can you do that?

You could do it using Computer Management. Open Computer Management on your machine and connect to Bob’s computer, then right-click on Bob’s computer and select Properties. Switch to the Advanced tab, and click Settings under Startup And Recovery options. Now go to Shutdown and under Action click Log Off Current User and then OK.

Of course some things are easier to do using a script:

strComputer = “”
Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
Set colOperatingSystems = objWMIService.ExecQuery (“SELECT * FROM Win32_OperatingSystem”)
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(0)
Next

Tinggalkan komentar