Script to Logout all Users Before Restarting RDS Servers

Multiple vendors have recommended logging out all users before restarting our RDS servers. Sadly I was never able to find a script that could do everything I wanted.

I created the script below for Server 2012 + servers. The script will do the following:
  • Logout all active users (even console users)
  • Write errors and information into the Application event log
You can find the script here:

The script will not reboot the server, but you can always add a shutdown -r -t 0 at the end, or schedule your reboot script to run right after this one.


  1. After a long time, I read a very beautiful and very important article that I enjoyed reading. I have found that this article has many important points, I sincerely thank the admin of this website for sharing it. Best anime discord servers service provider.


Post a Comment

Popular posts from this blog

Best Practices for Deploying User Profile Disks

Enabling Webcam on RDS

Deploying FSLogix Office 365 Containers