Az.Desktopvirtualization Powershell issues

%3CLINGO-SUB%20id%3D%22lingo-sub-1378997%22%20slang%3D%22en-US%22%3EAz.Desktopvirtualization%20Powershell%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1378997%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EThe%20Az.Desktopvirtualization%20module%20has%20some%20oddities%2C%20especially%20when%20compared%20to%20the%20previous%20module%20for%20Non-ARM.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E1%20%26nbsp%3BGet-AzWvdSessionHost%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20name%20column%20this%20cmdlet%20produces%20has%20the%20format%20below%3A%20%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWVD-Pool2%2FWVD-SH000000.ingram.micro%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20other%20AzWvd%20cmdlets%20require%20a%20session%20host%20name%20in%20FQDN%20format.%20The%20previous%20module%20produced%20FQDN%20names.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E2%26nbsp%3B%20Get-AzWvdUserSession%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20command%20does%20not%20have%20a%20column%20(unlike%20the%20previous%20module)%20for%20%3CSPAN%3ESessionhostname%3C%2FSPAN%3E.%20%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Name%20column%20produces%20the%20format%20below%3A%3C%2FP%3E%3CP%3E%3CSPAN%3EWVD-Pool2%2FWVD-SH000000.ingram.micro%2F2%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWhich%20is%20not%20directly%20useable%20considering%20the%20FQDN%20requirement%20mentioned%20at%20point%201.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20ID%20column%20contains%20a%20very%20long%20string%20as%20well%2C%20only%20producing%20a%20user%20session%20ID%20would%20be%20useful%20(as%20it%20was%20in%20the%20previous%20module).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E3%20Update-AzWvdSessionHost%26nbsp%3B-SubscriptionId%26nbsp%3B%24Az_Sub_Id%26nbsp%3B-HostPoolName%26nbsp%3B%24WVD_Hostpool%26nbsp%3B-ResourceGroupName%26nbsp%3B%24WVD_Hostpool_RG%26nbsp%3B-Name%26nbsp%3B%24FQDN%26nbsp%3B-AllowNewSession%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-AllowNewSession%20no%20longer%20acceps%20%24true%20or%20%24false.%20The%20cmdlet%20above%20can%20only%20be%20used%20to%20turn%20drain%20mode%20off%20on%20session%20hosts%20(if%20previously%20turned%20on%20via%20the%20management%20GUI).%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1399808%22%20slang%3D%22en-US%22%3ERe%3A%20Az.Desktopvirtualization%20Powershell%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1399808%22%20slang%3D%22en-US%22%3E%40%20Point%203%3B%3CBR%20%2F%3EThe%20currently%20accepted%20syntax%20to%20enable%20drain%20mode%20is%3A%3CBR%20%2F%3EUpdate-AzWvdSessionHost%20-SubscriptionId%20%24Az_Sub_Id%20-HostPoolName%20%24WVD_Hostpool%20-ResourceGroupName%20%24WVD_Hostpool_RG%20-Name%20%24FQDN%20-AllowNewSession%3A%24False%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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

1 Reply
@ 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