Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Log Off

Status
Not open for further replies.

aleks1429

Programmer
Aug 12, 2004
3
0
0
US
I am trying to remotely log off from a server. I am using the following code:

Set objSystemSet = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & strcomputer & "\root\cimv2")_
.InstancesOf("Win32_OperatingSystem")

WScript.Echo "Starting to Log-Off"
For Each objSystem In objSystemSet
Wscript.Echo objSystem.Name
objSystem.Win32Shutdown 0
Next
WScript.Echo "Done..."

The code works for a local box, but does not work for any boxes that are on the network. Could it be security related issue or else? Is there a way to do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top