Solved

VBscript to log off local machine

Posted on 2008-06-19
3
4,500 Views
Last Modified: 2010-04-21
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
Comment
Question by:azstbzimms
3 Comments
 
LVL 4

Expert Comment

by:Andre412
ID: 21827431
0
 
LVL 24

Accepted Solution

by:
purplepomegranite earned 400 total points
ID: 21827454
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
 

Author Closing Comment

by:azstbzimms
ID: 31469015
Perfect...Thanks!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now