Exporting Non-Compliant Resources from Azure Policies

Rudy Makiramdam 6 Reputation points
2022-08-22T18:59:09.653+00:00

Im trying to figure out a way to export the non-compliant resources from a specific Policy within ASC. I have tried the Get-AzPolicyState command but that does not give me the non-compliant resources within a policy.

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
836 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Rafael da Rocha 5,091 Reputation points
    2022-08-23T05:54:01.56+00:00

    Hello, you should be able to get results with something like this:

    Get-AzPolicyState -Filter "ComplianceState eq 'NonCompliant' and PolicySetDefinitionName eq 'your_policyset_definition_name'"  
    

    ----------

    If any reply helped solve your question, please remember to upvote and/or "Accept Answer".
    It helps others facing similar issues find the solution.