Solved

VBscript to log off local machine

Posted on 2008-06-19
3
4,499 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.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

12 Experts available now in Live!

Get 1:1 Help Now