Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WSH Log off user???

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1153
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WSH Log off user???
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WSH Log off user??? - 7/17/2004 7:42:56 AM   
  jgoodwin

 

Posts: 2
Score: 0
Joined: 7/17/2004
From: USA
Status: offline
Hi - I thought this would be easy, but haven't been able to find a way to log a disconnected user off of an XP system that uses fast user switching. I tried terminating explorer.exe using the following code, but this does not end their session (nor even kill explorer).

set processes = getobject("winmgmts://").InstancesOf("Win32_Process")

for each process in processes

if process.name = "explorer.exe" then
If process.GetOwner ( User, Domain ) = 0 Then
If User <> "Josh" Then
Wscript.Echo "Terminate Process " & Process.Caption & " belonging to " & Domain & "\" & User
process.terminate
end if
end if
end if

Any ideas?

Josh
 
 
Post #: 1
 
 Re: WSH Log off user??? - 7/20/2004 4:39:45 AM   
  jgoodwin

 

Posts: 2
Score: 0
Joined: 7/17/2004
From: USA
Status: offline
Well, no one has responded. I ended up figuring out a way to do it with command line functions. qwinsta and rwinsta are the name of them. I'll post my final script from home tonight. I'd still like a way to do it from vb.

(in reply to jgoodwin)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WSH Log off user??? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts