Avatar of Ray Padilla
Ray Padilla
Flag for United States of America asked on

Script to disconnect RDP sessions

I have about 12 users that will normally remote into our server to do some quickbooks work, I need then to log off the server when they are done working, this usually does not happen they will exit from QB but leave the session open. This causes me problems as I have several applications doing automated task every night. I need a batch file/Script that I can set to run every night at a certain time and completely log them off the server except myself the admin. As a courtesy I would like to send everyone logged on a quick message letting them know that "the server will log you off save your work you have 2 minutes"  then log everyone off the server again EXCEPT the admin.  I am running a Windows 2012 R2 server.
Windows BatchMicrosoft Server AppsMicrosoft Server OS

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
SOLUTION
Will Szymkowski

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray Padilla

ASKER
We are not using the server with any type of LDAP it is setup as an application server
Will Szymkowski

You do not do this on the server you use Group Policy Management Console for this.  

If you do not have an AD environment you can. Accomplish the same thing using local policy.

Use gpedit.msc to open local policy.

Follow the rest of the steps from the first link I posted.

Will.
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck