Solved

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

Posted on 2007-03-19
4
1,139 Views
Last Modified: 2008-02-01
is there a way using vbscript  to logoff remote desktop after session is login for 2 hours ?
0
Comment
Question by:jshao825
4 Comments
 
LVL 9

Expert Comment

by:Bill_Fleury
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.
0
 
LVL 25

Accepted Solution

by:
Ron Malmstead earned 250 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.Sleep(7200000)
Wscript.Echo "Your remote session limit has been reached, please save your work.  You will be logged off in 2 minutes"
Wscript.Sleep(120000)
set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.run strlogoff
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
There are several problems reported according slow link speeds or poor performance in TMG 2010, UAG 2010 or ISA 2006. I want to collect here some of the common issues together to give a brief overview what can be the reason. Nevertheless, not all of…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

815 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

8 Experts available now in Live!

Get 1:1 Help Now