Solved

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

Posted on 2007-03-19
4
1,157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

I have been asked to explain on many, many occasions the correct way to setup network cards and DNS settings on ISA Server 2004, 2006 and forefront Threat management gateway (FTMG) and have willing done so. I have also promised my self everytime tha…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
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…
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…

707 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