Forum Discussion
Az.Desktopvirtualization Powershell issues
Hello,
The Az.Desktopvirtualization module has some oddities, especially when compared to the previous module for Non-ARM.
1 Get-AzWvdSessionHost
The name column this cmdlet produces has the format below:
WVD-Pool2/WVD-SH000000.ingram.micro
However, other AzWvd cmdlets require a session host name in FQDN format. The previous module produced FQDN names.
2 Get-AzWvdUserSession
The cmdlet does not produce a column (unlike the previous module) for Sessionhostname.
The Name column produces the format below:
WVD-Pool2/WVD-SH000000.ingram.micro/2
Which is not directly useable considering the FQDN requirement mentioned at point 1.
The ID column contains a very long string as well, only producing a user session ID would be useful (as it was in the previous module).
3 Update-AzWvdSessionHost -SubscriptionId $Az_Sub_Id -HostPoolName $WVD_Hostpool -ResourceGroupName $WVD_Hostpool_RG -Name $FQDN -AllowNewSession
-AllowNewSession no longer acceps $true or $false. The cmdlet above can only be used to turn drain mode off for session hosts (if previously turned on via the management GUI).
- MaranVerweijCopper Contributor@ Point 3;
The currently accepted syntax to enable drain mode is:
Update-AzWvdSessionHost -SubscriptionId $Az_Sub_Id -HostPoolName $WVD_Hostpool -ResourceGroupName $WVD_Hostpool_RG -Name $FQDN -AllowNewSession:$False