I tested this in a MOM environment as a automated response to a rule. Basically if you monitor the event logs for event # : 538, and the user name: "Insert Username Here" you can have this script run as a automated response to log them back off.
Enjoy!
' Connect to computer
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
' Actual logoff
for each OpSys in OpSysSet
OpSys.Win32Shutdown 4
next
for each OpSys in OpSysSet
OpSys.Win32Shutdown 4
next
' Done
WScript.Quit(0)
WScript.Quit(0)
No comments:
Post a Comment