Alan's Blog

"Yeah. I wrote a script that will do that."

Shutdown if logged off

Posted on July 12th, 2011

Power management is a big deal because turning off computers can save you company a lot of money.  However, turning off a locked computer could cause a data loss.  Finding out who is always locked is also important.

ShutdownIfLoggedOff.vbs will allow you to choose how to handles this.  You can 1) Always logoff, even if a user is logged on, 2) Never logoff user.  Send admin email, 3) Logoff user, send admin email, and 4) begin logoff, but allow user to abort.  The mail send is SNMP, which can make some anti-virus programs complain.

You can run this with a scheduled job, PSExec, SMS/SCCM, but it must run locally with admin rights.

Tags:
Filed under VbScript, Windows Administration | No Comments »

Please Note

All the scripts are saved as .txt files. Newer files have a "View Script" button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use "Save Target As". Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with Version 3 or 4.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient. It is pretty easy to figure out my email address from the scripts, and you are welcome to contact me that way.

Site Search

Categories

Archives

SQL Site

Bad Behavior has blocked 169 access attempts in the last 7 days.