Exporting Non-Compliant Resources from Azure Policies

rmak75 6 Reputation points

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.
804 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Rafael da Rocha 5,076 Reputation points

    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.