vbscript to logoff remote desktop after session is login for 2 hours

Posted on 2007-03-19
Medium Priority
Last Modified: 2008-02-01
is there a way using vbscript  to logoff remote desktop after session is login for 2 hours ?
Question by:jshao825

Expert Comment

ID: 18751047
I don't know about vbscript, but you can do this with Group Policy.

Hit start --> run --> GPEDIT.MSC

Navigate to:

Computer Configuration --> Administrative Templates --> Terminal Services --> Sessions

All of the options for time limits on Remote desktop are listed there.  You can also set the session limits in Active Directory if this computer is a member of an AD domain.
LVL 25

Accepted Solution

Ron Malmstead earned 1000 total points
ID: 18783030
VBS script.....put the .vbs file in the "%alluserprofile%\start menu\programs\startup" on the terminal server.
strlogoff = "cmd /c logoff.exe"
Wscript.Echo "Your remote session limit has been reached, please save your work.  You will be logged off in 2 minutes"
set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.run strlogoff

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Suggested Courses

627 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