guyrleech

Get AVD User Sessions

May 3rd, 2026
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.53 KB | Cybersecurity | 0 0
  1. ## Get AVD user sessions for all hostpools in current context
  2.  
  3. Get-AzWvdHostPool -PipelineVariable hpool | ForEach-Object { Get-AzWvdUserSession  -HostPoolName $hpool.name -ResourceGroupName $hpool.ResourceGroupName }|select @{n='HostPool';e={$hpool.Name}},@{n='FriendlyName';e={$hpool.FriendlyName}},@{n='ResourceGroup';e={$hpool.ResourceGroupName}},@{n='Location';e={$hpool.location}},UserPrincipalName,@{n='Host';e={$_.Name -replace '^.*/(.+)/.*$' , '$1' }},ApplicationType,CreateTime,SessionState,@{n='SessionId';e={split-path $_.Id -leaf }}
Tags: avd vdi wvd
Advertisement
Add Comment
Please, Sign In to add comment