• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4511
  • Last Modified:

VBscript to log off local machine

Looking for a simple VBscript that can be launched from any local WinXP workstation that will log off the user that is logged on.  I don't want to have to specify the machine name; just log off the session.

Thanks!
0
azstbzimms
Asked:
azstbzimms
1 Solution
 
purplepomegraniteCommented:
The attached should do it.
Set objOS = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem")
 
for each objSys in objOS
	objSys.Win32Shutdown 0
next

Open in new window

0
 
azstbzimmsAuthor Commented:
Perfect...Thanks!
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now