PowerShell Module: How to List all Host Pools in all Workspaces

PowerShell Module: How to List all Host Pools in all Workspaces

This feature is only available in the Nerdio Manager Premium edition.

Welcome to this tutorial where we explore exciting new functionality in Nerdio Manager. This tutorial shows you how to list all host pools in a workspace and discover the associated workspace, resource group, and more.

Note: The PowerShell Module for Nerdio Manager is in public preview. Please submit your feedback here.

Prerequisites

Install the PowerShell module. See PowerShell Module: Tutorial for details.

Get the List of Workspaces

To begin, we need to retrieve the list of workspaces using the Get-NmeWorkspace cmdlet. This cmdlet provides us with the necessary information to identify the workspaces associated with our Azure Virtual Desktop deployment.

  • $workspaces = Get-NmeWorkspace

Iterate through Workspaces and List Host Pools

Next, we iterate through the retrieved list of workspaces and use the Get-NmeWorkspaceSessionHost cmdlet to list the host pools associated with each workspace. This provides us with details such as the workspace name, resource group, and any additional relevant information.

foreach ($workspace in $workspaces) {

$hostPools = Get-NmeWorkspaceSessionHost -SubscriptionId $workspace.Id.SubscriptionId -ResourceGroup $workspace.Id.ResourceGroup -WorkspaceName $workspace.Id.Name

Write-Host "Workspace Name: $($workspace.WorkspaceName)"

foreach ($hp in $hostPools) {

Write-Host "Host Pool Workspaca: $($hp.WorkspaceName)"

Write-Host "Host Pool Name: $($hp.Hostpool.HostpoolName)"

Write-Host "Host Pool Resource Group: $($hp.Hostpool.ResourceGroup)"

Write-Host "Host Pool Subscription: $($hp.Hostpool.Subscription)"

# Add any additional desired information about the host pool here

}

}

Conclusion

Congratulations! You have successfully learned how to leverage new functionality in Azure Virtual Desktop to list all host pools within a workspace, along with associated details such as workspace name and resource group. Remember to explore further and customize these examples to suit your specific requirements.

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Article is closed for comments.