Skip to content
INSIGHTS & GUIDES · NETCLOUD24

How to Drain an RDS Session Host for Maintenance

Read the article ↓
Editorial illustration: How to Drain an RDS Session Host for Maintenance

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

  1. Notify users and confirm the maintenance window.
  2. Place the selected host in drain mode.
  3. Review existing sessions and contact remaining users.
  4. Perform maintenance after sessions end.
  5. Validate health and enable logons again.

Commands

change logon /drain
quser
Get-RDUserSession | Sort-Object HostServer,UserName
change logon /enable

Verification

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.


Was this answer helpful?

« Back
Contact

Write to us

Do you have questions about our services or need a quote? Write to us and we will respond as soon as possible.

Contact form

Fields marked * are required.