Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Force User Logoff
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 23rd May 07:17
matjaz ladava [mvp]
External User
 
Posts: 1
Default Force User Logoff



This code should do the trick. Change "." in computer name to a remote computer name ("." is local computer)


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

--
Regards

Matjaz Ladava, MCSE (NT4 & 2000), MVP
matjaz@ladava.com
http://ladava.com
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666