Solved

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

Posted on 2007-03-19
4
1,143 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
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…

838 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