SOLVED

Assign users to RemoteApp group by PowerShell

Copper 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.

5 Replies

@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...

 

best response confirmed by altoControl (Copper Contributor)
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
Exactly what I need, thanks.
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 :)

Spot on! Thanks!!! @Jamesatighe 

1 best response

Accepted Solutions
best response confirmed by altoControl (Copper Contributor)
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

View solution in original post