nerdexam
Microsoft

AZ-400 · Question #313

Hotspot Question You are using PowerShell to administer Azure Log Analytics workspaces. You need to list the available workspaces and their properties. How should you complete the command? To answer,

This question tests knowledge of the correct PowerShell cmdlet and syntax used to retrieve Azure Log Analytics workspaces and their properties. The command must use the Az module with the appropriate cmdlet for Log Analytics.

Submitted by tunde_lagos· Mar 6, 2026Implement an instrumentation strategy

Question

Hotspot Question You are using PowerShell to administer Azure Log Analytics workspaces. You need to list the available workspaces and their properties. How should you complete the command? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. Answer:

Exhibit

AZ-400 question #313 exhibit

Answer Area

  • Commandlet
    Get-AzResourceGet-AzResourceGroupGet-AzResourceProvider
  • Parameter
    -ResourceGroupName-ResourceId-ResourceType

Explanation

This question tests knowledge of the correct PowerShell cmdlet and syntax used to retrieve Azure Log Analytics workspaces and their properties. The command must use the Az module with the appropriate cmdlet for Log Analytics.

Approach. The correct command is 'Get-AzOperationalInsightsWorkspace', which is part of the Az.OperationalInsights PowerShell module. This cmdlet lists all Log Analytics workspaces in a subscription or resource group along with their properties such as workspace ID, SKU, retention period, and provisioning state. The full command syntax would be: 'Get-AzOperationalInsightsWorkspace' optionally followed by '-ResourceGroupName <ResourceGroupName>' to scope results to a specific resource group. The module must be imported with 'Import-Module Az.OperationalInsights' if not already loaded.

Concept tested. Knowledge of Azure PowerShell Az module cmdlets, specifically the Az.OperationalInsights module and the 'Get-AzOperationalInsightsWorkspace' cmdlet used to enumerate and inspect Azure Log Analytics workspace properties via PowerShell.

Reference. https://learn.microsoft.com/en-us/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspace

Topics

#Azure PowerShell#Log Analytics#Azure Resource Management

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice