Forum Discussion
Reassigning Personal WVD
iggyemu I had a similar ask
https://docs.microsoft.com/en-us/powershell/module/windowsvirtualdesktop/remove-rdssessionhost
From above powershell doco it states that
When running this command to remove a session host from a persistent host pool, the user assignment is also removed. This is the only way to re-assign a user to a new session host in a persistent host pool.
So the best I was able to achieve was
Remove-RdsSessionHost -TenantName TenantXYZ -HostPoolName PoolABC -Name SessionHostToBeRefreshed
Generate a new token for the session pool via
New-RdsRegistrationInfo -TenantName TenantXYZ -HostPoolName PoolABC -ExpirationHours 1
(Export-RdsRegistrationInfo -TenantName TenantXYZ -HostPoolName PoolABC ).Token
Log onto that machine and remove the "Remote Desktop Services Infrastructure Agent" - if there are multiple versions make sure to remove every single one.
The reinstall it (there should be a copy under C:\Program Files\Microsoft RDInfra\Microsoft.RDInfra.RDAgent.Installer-x64.msi)
And when prompted use the token that you generated earlier.
It will take about 5mins for the session host to rejoin.
I would very much prefer a powershell command that can remove assignment rather than uninstalling an agent!