question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked AmitaMenon-3691 edited

WVD syntax correction

Hi

I am new to WVD and i am using wvd classic. I want to assign/remove the user to WVD app group. Please correct me if the below syntaxes are correct.

To create
Add-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "maxwell@mydomain.com"

To Delete WVD

Remove-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "maxwell@mydomain.com"

What is the syntax to get the session hostname for this wvd.

Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "maxwell@mydomain.com"

Get-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "maxwell@mydomain.com"

azure-virtual-desktop
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GlennMaxwell-2309 Any updates on the issue?

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

Thanks




0 Votes 0 ·
prmanhas-MSFT avatar image
0 Votes"
prmanhas-MSFT answered

@GlennMaxwell-2309 Thank you for your query!!!

First thing I would recommend you is to migrate from Classic which doesn't support Azure Resource Manager Windows Virtual Desktop objects and will as well retire in coming time. More info here.Final call is all yours though :)

To add users to the WVD App Group Classic as mentioned here below command is recommended:

Add-RdsAppGroupUser <tenantname> <hostpoolname> <appgroupname> -UserPrincipalName <userupn>

So the above syntax is correct which you have mentioned.

Similarly for removing user from Group as mentioned here:

Remove-RdsAppGroup
[-TenantName] <String>
[-HostPoolName] <String>
[-Name] <String>
[<CommonParameters>]

So above syntax is correct.

You can use below command for getting wvd session hostname for a user:

Get-RdsSessionHost
[-TenantName] <String>
[-HostPoolName] <String>
[-Name <String>]
[<CommonParameters>]

The Get-RdsSessionHost cmdlet gets the properties of the specified session host. If you do not specify a session host, this cmdlet returns all session hosts in the host pool.

So this one is correct as well as mentioned here.

Again the last one is correct as well. As mentioned here

The Get-RdsAppGroupUser cmdlet lists the users that have access to the specified app group. If you specify a user principal name, this cmdlet either returns the specified user principal name who has access to the app group or an error indicating that they do not have access.

Get-RdsAppGroupUser
[-TenantName] <String>
[-HostPoolName] <String>
[-AppGroupName] <String>
[-UserPrincipalName <String>]
[<CommonParameters>]


Overall syntax are correct and with needed access you are good to go.

Hope it help!!!

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.








5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 answered prmanhas-MSFT commented

I am getting the below error. user maxwell is able to login to WVD

PS C:\Windows\system32> Get-RdsAppGroupUser -TenantName "MyTenant" -HostPoolName MyPool -AppGroupName "WVD Desktop" -UserprincipalName maxwell@mydomain.com
UserPrincipalName : maxwell@mydomain.com
TenantName : MyTenant
TenantGroupName : Default Tenant Group
HostPoolName : MyPool
AppGroupName : WVD Desktop



Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -UserPrincipalName "maxwell@mydomain.com"
Get-RdsSessionHost : A parameter cannot be found that matches parameter name 'AppGroupName'.
At line:1 char:80
+ ... "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-RdsSessionHost], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.RDInfra.RDPowershell.SessionHost.GetRdsSessionHost

Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD Desktop" -Name "maxwell@mydomain.com"
Get-RdsSessionHost : A parameter cannot be found that matches parameter name 'AppGroupName'.
At line:1 char:80
+ ... "MyTenant" -HostPoolName "MyPool" -AppGroupName "WVD ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-RdsSessionHost], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.RDInfra.RDPowershell.SessionHost.GetRdsSessionHost


when i use the below syntax i am getting output but i am getting for all the users.

Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool"

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GlennMaxwell-2309 Apologies for the delay in response and all the inconvenience caused because of the issue.

I am checking it internally and will keep you posted on same.

Thanks

0 Votes 0 ·

@GlennMaxwell-2309 The user has to use WVD for the session host to be assigned to them. Can you please confirm if there are there enough session hosts in the pool?

Also can you check for the single user, use the 'Where-Object' clause after the Pipe '|'.

Example: Get-RdsSessionHost -TenantName "MyTenant" -HostPoolName "MyPool" | Where-Object -Property AssignedUser -Eq 'user2@contoso.com'

See this for example: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.1#examples

Hope it help!!!

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.




0 Votes 0 ·