Open In App

Microsoft Azure – Get Azure Policies Definitions and Policy Initiatives Definitions

Last Updated : 31 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will be using some Azure PowerShell Commands either in Azure Cloud Shell or in Azure PowerShell ISE in Admin mode to get the details and properties about the Azure Policies. Let’s get started.

1. Use the Get-AzPolicyStateSummary PowerShell command to get the details of the azure policy compliance status of Non-Compliant Resources and Non-Compliant Policies.

Get-AzPolicyStateSummary

Output:

2. Use the Get-AzPolicySetDefinition PowerShell command to get Azure Policy Initiative Definitions

Get-AzPolicySetDefinition

The command returns the properties of all the Azure Policy Initiative Definitions.

Output:

3. Use (Get-AzPolicySetDefinition).count PowerShell command to get the count of Azure Policy Initiative Definitions.

(Get-AzPolicySetDefinition).count

The command returns the count of the total number of Azure Policy Initiative Definitions.

Output:

4. Use Get-AzPolicyDefinition PowerShell command to get the Azure Policy Definitions list and properties.

Get-AzPolicyDefinition

The command returns the properties of all the Azure Policy Definitions.

Output:

5. Use (Get-AzPolicyDefinition).count PowerShell command to get the count of Azure Policy Definitions.

(Get-AzPolicyDefinition).count

The command returns the count of the total number of Azure Policy Definitions.

Output:


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads