Share via

Adjust realtive weights for hosts in RDS farm using powershell?

Dustin 0 Reputation points
2026-03-19T14:09:02.5133333+00:00

I've found some information that its not possible to adjust relative weights for Hosts in a RDS Collection anymore. It seem that the .NET-Type behind <RDSessionHostCollectionLoadBalancingInstance[]>] was discontinued with Windows Server 2022.

Is there any proven way how to adjust the weights for hosts in a RDS farm using Powershell?

Thanks in advance!

Windows for business | Windows Server | User experience | Remote desktop services and terminal services
0 comments No comments

2 answers

Sort by: Most helpful
  1. Harry Phan 17,360 Reputation points Independent Advisor
    2026-03-19T14:50:36.5766667+00:00

    Hello Dustin,

    You’re correct! On Windows Server 2022 and newer, the old PowerShell method of adjusting per-host RDS collection weights through RDSessionHostCollectionLoadBalancingInstance[] is no longer a supported or exposed management path. That underlying .NET type/property chain was effectively removed from the usable RDS PowerShell surface, so there is currently no built-in, supported PowerShell command to set custom relative host weights in an RD Session Host collection the way older versions allowed. On current builds, Microsoft still supports changing collection-level load balancing behavior through the standard RDS cmdlets, but not per-host weighting through deprecated internals.

    If you need to influence session placement now, the supported options are to drain or restrict individual hosts with Set-RDSessionHost -NewConnectionAllowed, split workloads into separate collections, or redesign broker behavior around collection boundaries instead of host weights. I would strongly avoid relying on old scripts that poke deprecated objects or WMI paths, because they are no longer reliable on Server 2022/2025 and can break after updates.

    I hope you find something helpful with this asnwer. Please give it a thump up, or accept it if it's helpful to you.

    Harry.

    1 person found this answer helpful.

  2. Q&A Assist
    2026-03-19T14:09:14.1833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Adjusting per-host load-balancing weights for an RDS session collection is still possible, but not via the -LoadBalancing parameter on Set-RDSessionCollectionConfiguration in Windows Server 2022+, since that parameter’s backing type is no longer available.

    A supported way to set host weights is to use the WMI class Win32_TSSessionDirectory and its SetServerWeight method on the RD Connection Broker. This method sets the server weight value used for RD Connection Broker load balancing.

    Key details from SetServerWeight:

    • Class: Win32_TSSessionDirectory
    • Namespace: Root\CIMv2\TerminalServices
    • Method: SetServerWeight
    • Parameter: ServerWeightValue (type uint32, valid range 1–10000)
    • The weight is relative: if one server is 100 and another is 200, the 200-weight server receives roughly twice as many sessions.

    In PowerShell, the pattern is:

    # Example pattern (run on the RD Connection Broker)
    $tsDir = Get-WmiObject -Namespace 'Root\CIMv2\TerminalServices' -Class 'Win32_TSSessionDirectory'
    $tsDir.SetServerWeight(<ServerWeightValue>)
    

    Use a value between 1 and 10000 for <ServerWeightValue> according to how heavily each host should be favored. Repeat on each RD Session Host (or via a script that targets each host) as appropriate for the farm’s configuration.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.