Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-03-19
4
Medium Priority
?
1,172 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 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.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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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). …

636 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