Applies to: Windows Server 2019, Windows Server 2022, and Windows Server 2025.
Drain mode blocks new logons to one RDS Session Host while allowing current users to complete work before maintenance.
Prerequisites
- Administrative access and an approved change window.
- A verified backup and documented rollback plan.
- A pilot environment or low-risk target for validation.
Step-by-step procedure
- Notify users and confirm the maintenance window.
- Place the selected host in drain mode.
- Review existing sessions and contact remaining users.
- Perform maintenance after sessions end.
- Validate health and enable logons again.
Commands
change logon /drain
quser
Get-RDUserSession | Sort-Object HostServer,UserName
change logon /enableVerification
New sessions are directed elsewhere and the maintained host accepts connections after it is re-enabled.
Rollback
Run change logon /enable immediately if capacity or brokering is affected, then validate host health.
Security notes
- Use least privilege and record the change.
- Review relevant event logs after implementation.
- Test before production rollout.
Drain sessions without silently ending user work
Draining prevents new sign-ins while allowing existing work to finish according to the selected mode. It does not automatically log off every user, and a disconnected session can still contain running applications. Distinguish drain behaviour from disabling all logons before scheduling maintenance.
Run the local change logon command on the intended session host and inspect the collection through the correct Connection Broker when using deployment-level tools. Record the host name in the change ticket so an administrator does not drain another server by mistake. Notify affected users and agree on the last permitted session time.
Review active and disconnected sessions with their owners. Do not turn an expired maintenance window into permission to discard unsaved work. If a forced logoff is unavoidable, obtain the operational approval required for that workload and preserve the application’s recovery procedure.
After patching or restarting, verify the server’s application, licensing connectivity and collection health before enabling new logons. Re-enable access, test a normal user journey and monitor the first sessions. A host that accepts credentials but fails to launch the application has not completed its maintenance verification.
Related resources
Canadian Windows VPS and RDS hosting: managed Windows VPS hosting. Refer to Microsoft Windows Server documentation.
How to Install the Remote Desktop Session Host Role
How to Install the Remote Desktop Session Host RoleApplies to: Windows Server 2019, 2022 and 2025.RD Session Host runs multi-user desktop…
How to Install and Activate an RDS Licensing Server
How to Install and Activate an RDS Licensing ServerApplies to: Windows Server 2019, 2022 and 2025.RD Licensing stores and issues eligible…
How to Configure RDS Licensing Mode and License Server with Group Policy
How to Configure RDS Licensing Mode and License Server with Group PolicyApplies to: Windows Server 2019, 2022 and 2025.Session Hosts need…
How to Create an RDS Session Collection with PowerShell
How to Create an RDS Session Collection with PowerShellApplies to: Windows Server 2019, 2022 and 2025.A session collection groups Session…
How to Publish a Windows Application as RemoteApp
How to Publish a Windows Application as RemoteAppApplies to: Windows Server 2019, 2022 and 2025.RemoteApp presents an approved program…