SOLVED

Assign users to RemoteApp group by PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1443520%22%20slang%3D%22en-US%22%3EAssign%20users%20to%20RemoteApp%20group%20by%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1443520%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20add%20users%20to%20a%20RemoteApp%20application%20group%20but%20I%20want%20to%20do%20it%20purely%20in%20PowerShell.%3C%2FP%3E%3CP%3EIn%20previous%20versions%20(fall%202019)%20I%20could%20do%20this%20by%20using%20%22Add-RdsAppGroupUser%22%20command%20wich%20dosent%20work%20anymore.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fmanage-app-groups%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fmanage-app-groups%3C%2FA%3E%3C%2FP%3E%3CP%3EThis%20link%20shows%20how%20to%20do%20it%20but%20only%20mentios%20Azure%20Portal.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20do%20this%20now%20using%20only%20Powershell%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1444579%22%20slang%3D%22en-US%22%3ERe%3A%20Assign%20users%20to%20RemoteApp%20group%20by%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1444579%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F643328%22%20target%3D%22_blank%22%3E%40altoControl%3C%2FA%3E%26nbsp%3BYou%20need%20the%20new%20Spring%20Release%20PowerShell%20cmdlets%20-%20Instructions%20of%20how%20to%20get%20these%20are%20here%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fpowershell-module%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fpowershell-module%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20then%20use%20the%20new%20New-AZWVDApplication%20Powershell%20cmdlets%20to%20create%20a%20RemoteApp%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.desktopvirtualization%2Fnew-azwvdapplication%3Fview%3Dazps-4.2.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.desktopvirtualization%2Fnew-azwvdapplication%3Fview%3Dazps-4.2.0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1446976%22%20slang%3D%22en-US%22%3ERe%3A%20Assign%20users%20to%20RemoteApp%20group%20by%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1446976%22%20slang%3D%22en-US%22%3EUnfortunately%20this%20doesn%E2%80%99t%20answer%20the%20OPs%20question.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20new%20Az.DesktopVirtualization%20PowerShell%20module%20includes%20a%20lot%20of%20commands%20but%20does%20not%20seem%20to%20include%20a%20direct%20replacement%20for%20the%20Add-RdsAppGroupUser%20which%20is%20what%20he%20asks%20for.%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20is%20because%20assignment%20of%20users%20to%20Application%20groups%20in%20Spring%202020%20is%20done%20via%20Azure%20Role%20Definitions.%3CBR%20%2F%3E%3CBR%20%2F%3EMicrosoft%20example%20of%20this%20is%20as%20below%3A%3CBR%20%2F%3E%3CBR%20%2F%3ENew-AzRoleAssignment%20-SignInName%20%3CUSERUPN%3E%20-RoleDefinitionName%20%22Desktop%20Virtualization%20User%22%20-ResourceName%20%3CAPPGROUPNAME%3E%20-ResourceGroupName%20%3CRESOURCEGROUPNAME%3E%20-ResourceType%20'Microsoft.DesktopVirtualization%2FapplicationGroups'%3CBR%20%2F%3E%3CBR%20%2F%3EI%20believe%20that%20this%20example%20of%20adding%20a%20user%20to%20the%20Desktop%20Application%20group.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20will%20try%20this%20myself%20to%20test.%3CBR%20%2F%3E%3CBR%20%2F%3EJames%3C%2FRESOURCEGROUPNAME%3E%3C%2FAPPGROUPNAME%3E%3C%2FUSERUPN%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1452036%22%20slang%3D%22en-US%22%3ERe%3A%20Assign%20users%20to%20RemoteApp%20group%20by%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1452036%22%20slang%3D%22en-US%22%3EExactly%20what%20I%20need%2C%20thanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1452058%22%20slang%3D%22en-US%22%3ERe%3A%20Assign%20users%20to%20RemoteApp%20group%20by%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1452058%22%20slang%3D%22en-US%22%3EGlad%20it%20helped.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20had%20exactly%20the%20same%20issue%20as%20I%20want%20to%20automate%20adding%20users%20via%20PowerShell.%20It%20took%20me%20a%20while%20to%20find%20that%20but%20does%20what%20I%20need%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello everyone.

 

I need to add users to a RemoteApp application group but I want to do it purely in PowerShell.

In previous versions (fall 2019) I could do this by using "Add-RdsAppGroupUser" command wich dosent work anymore.

 

https://docs.microsoft.com/en-us/azure/virtual-desktop/manage-app-groups

This link shows how to do it but only mentios Azure Portal.

 

How can I do this now using only Powershell?

 

Thanks.

4 Replies
Highlighted

@altoControl You need the new Spring Release PowerShell cmdlets - Instructions of how to get these are here - https://docs.microsoft.com/en-us/azure/virtual-desktop/powershell-module

 

You can then use the new New-AZWVDApplication Powershell cmdlets to create a RemoteApp

 

https://docs.microsoft.com/en-us/powershell/module/az.desktopvirtualization/new-azwvdapplication?vie...

 

Highlighted
Solution
Unfortunately this doesn’t answer the OPs question.

The new Az.DesktopVirtualization PowerShell module includes a lot of commands but does not seem to include a direct replacement for the Add-RdsAppGroupUser which is what he asks for.

This is because assignment of users to Application groups in Spring 2020 is done via Azure Role Definitions.

Microsoft example of this is as below:

New-AzRoleAssignment -SignInName <userupn> -RoleDefinitionName "Desktop Virtualization User" -ResourceName <appgroupname> -ResourceGroupName <resourcegroupname> -ResourceType 'Microsoft.DesktopVirtualization/applicationGroups'

I believe that this example of adding a user to the Desktop Application group.

I will try this myself to test.

James
Highlighted
Exactly what I need, thanks.
Highlighted
Glad it helped.

I had exactly the same issue as I want to automate adding users via PowerShell. It took me a while to find that but does what I need :)