SOLVED

The case of Persistent, SessionHost assignment remains even if the user is unassigned from AppGroup.

%3CLINGO-SUB%20id%3D%22lingo-sub-998489%22%20slang%3D%22en-US%22%3EThe%20case%20of%20Persistent%2C%20SessionHost%20assignment%20remains%20even%20if%20the%20user%20is%20unassigned%20from%20AppGroup.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-998489%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIs%20this%20in%20the%20specifications%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EHere%20is%20what%20I%20tried%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E1).%20Created%20HostPool%20as%20a%20personal%20type%20(persitent%20is%20true).%26nbsp%3B%3C%2FP%3E%3CP%3E2).%20After%20signing%20in%20as%20a%20user%2C%20that%20user%20was%20assigned%20to%20the%20session%20host.%26nbsp%3B%3C%2FP%3E%3CP%3E3).%26nbsp%3BUnassigned%20the%20user%20from%20AppGroup.%3C%2FP%3E%3CP%3E4).%20Failed%20to%20connect%20as%20another%20user.%3C%2FP%3E%3CP%3E5).%20Checked%20the%20session%20host%20properties%2C%20the%20previous%20user%20was%20still%20assigned.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1065586%22%20slang%3D%22en-US%22%3ERe%3A%20The%20case%20of%20Persistent%2C%20SessionHost%20assignment%20remains%20even%20if%20the%20user%20is%20unassigned%20from%20AppGr%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1065586%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F354204%22%20target%3D%22_blank%22%3E%40kyohei_%3C%2FA%3E%26nbsp%3B%3A%20Yes%2C%20this%20behavior%20is%20by%20design%2C%20in%20two%20ways%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20The%20removal%20of%20the%20user%20from%20the%20app%20group%20does%20not%20remove%20the%20session%20host%20assignment.%3C%2FP%3E%0A%3CP%3E2.%20Through%20the%20cmdlets%2C%20you%20can't%20simply%20re-assign%20a%20session%20host%20to%20a%20different%20user.%20We%20view%20this%20as%20tight%20security%2C%20since%20a%20user%20likely%20had%20local%20data%20on%20the%20VM%20(as%20opposed%20to%20the%20pooled%20scenario%20where%20that%20user's%20profile%20was%20on%20a%20user%20profile%20share).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20re-assign%20that%20session%20host%2C%20you%20need%20to%20completely%20remove%20it%20from%20the%20environment%2C%20then%20re-register%20the%20host.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1112543%22%20slang%3D%22en-US%22%3ERe%3A%20The%20case%20of%20Persistent%2C%20SessionHost%20assignment%20remains%20even%20if%20the%20user%20is%20unassigned%20from%20AppGr%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1112543%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F305776%22%20target%3D%22_blank%22%3E%40christianmontoya%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Christian%2C%20with%20regards%20to%20the%20statement%20below%2C%20could%20you%20give%20more%20information%20on%20the%20correct%20steps%20to%20complete%20this%20for%20this%20for%20a%20direct%20assignment%20on%20a%20'personal%20session%20host'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%22To%20re-assign%20that%20session%20host%2C%20you%20need%20to%20completely%20remove%20it%20from%20the%20environment%2C%20then%20re-register%20the%20host.%22%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1113194%22%20slang%3D%22en-US%22%3ERe%3A%20The%20case%20of%20Persistent%2C%20SessionHost%20assignment%20remains%20even%20if%20the%20user%20is%20unassigned%20from%20AppGr%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1113194%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F307498%22%20target%3D%22_blank%22%3E%40gerry_1974%3C%2FA%3E%26nbsp%3B%3A%20Sure.%20So%20essentially%2C%20you%20would%20need%20to%20remove%20the%20session%20host%20and%20then%20get%20new%20registration%20info%20for%20the%20host%20pool%20so%20you%20can%20re-add%20it.%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-ruby%22%3E%3CCODE%3ERemove-RdsSessionHost%20-TenantName%20%3CTENANTNAME%3E%20-HostPoolName%20%3CHOSTPOOLNAME%3E%20-Name%20%3CFULLSESSIONHOSTCOMPUTERNAME%3E%0A%0A%24token%20%3D%20New-RdsRegistrationInfo%20-TenantName%20%3CTENANTNAME%3E%20-HostPoolName%20%3CHOSTPOOLNAME%3E%0A%0A%24token.Token%3C%2FHOSTPOOLNAME%3E%3C%2FTENANTNAME%3E%3C%2FFULLSESSIONHOSTCOMPUTERNAME%3E%3C%2FHOSTPOOLNAME%3E%3C%2FTENANTNAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3BThen%2C%20go%20to%20the%20VM%20and%20uninstall%20all%20of%20the%20agents%20in%20the%20installed%20programs.%20Likely%2C%20you'll%20want%20to%20re-start%20the%20computer.%20Then%2C%20follow%20the%20steps%20here%20to%20re-install%20the%20agents%20with%20that%20Registration%20Token%2C%20using%20the%20steps%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fcreate-host-pools-powershell%23register-the-virtual-machines-to-the-windows-virtual-desktop-host-pool%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-desktop%2Fcreate-host-pools-powershell%23register-the-virtual-machines-to-the-windows-virtual-desktop-host-pool%3C%2FA%3E%26nbsp%3B.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1114895%22%20slang%3D%22en-US%22%3ERe%3A%20The%20case%20of%20Persistent%2C%20SessionHost%20assignment%20remains%20even%20if%20the%20user%20is%20unassigned%20from%20AppGr%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1114895%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F305776%22%20target%3D%22_blank%22%3E%40christianmontoya%3C%2FA%3EOnce%20again%2C%20thanks%20Christian.%20A%20great%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Is this in the specifications?

Here is what I tried:

1). Created HostPool as a personal type (persitent is true). 

2). After signing in as a user, that user was assigned to the session host. 

3). Unassigned the user from AppGroup.

4). Failed to connect as another user.

5). Checked the session host properties, the previous user was still assigned.

4 Replies
Highlighted
Best Response confirmed by kyohei_ (Occasional Contributor)
Solution

@kyohei_ : Yes, this behavior is by design, in two ways:

 

1. The removal of the user from the app group does not remove the session host assignment.

2. Through the cmdlets, you can't simply re-assign a session host to a different user. We view this as tight security, since a user likely had local data on the VM (as opposed to the pooled scenario where that user's profile was on a user profile share).

 

To re-assign that session host, you need to completely remove it from the environment, then re-register the host.

Highlighted

@christianmontoya 

 

Hi Christian, with regards to the statement below, could you give more information on the correct steps to complete this for this for a direct assignment on a 'personal session host'.

 

"To re-assign that session host, you need to completely remove it from the environment, then re-register the host."

Highlighted

@gerry_1974 : Sure. So essentially, you would need to remove the session host and then get new registration info for the host pool so you can re-add it.

Remove-RdsSessionHost -TenantName <tenantName> -HostPoolName <hostPoolName> -Name <fullSessionHostComputerName>

$token = New-RdsRegistrationInfo -TenantName <tenantName> -HostPoolName <hostPoolName>

$token.Token

 Then, go to the VM and uninstall all of the agents in the installed programs. Likely, you'll want to re-start the computer. Then, follow the steps here to re-install the agents with that Registration Token, using the steps here: https://docs.microsoft.com/azure/virtual-desktop/create-host-pools-powershell#register-the-virtual-m... .

Highlighted