Skip to content
Related Articles

Related Articles

Microsoft Azure – Get Azure Policies Definitions and Policy Initiatives Definitions

View Discussion
Improve Article
Save Article
  • Last Updated : 21 Feb, 2022

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:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!