How to get Scope of policy exemption by powershell

D Mallikarjuna Reddy 96 Reputation points
2023-02-07T16:38:09.6166667+00:00

I am trying to get details like Exemption Scope, actual name, exclusion (not just exemptions), created by(author - not a string, need a proper name) like its showing in Azure Portal.

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
791 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,931 Reputation points
    2023-02-09T09:23:17.4433333+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query

    To get the scope of policy exemption by PowerShell, you can use the Get-Gpo cmdlet. This cmdlet allows you to retrieve information about Group Policy Objects (GPOs), including the scope of policy exemption. To get the scope of policy exemption, use the Get-Gpo cmdlet with the -All parameter and the | Select-Object cmdlet to select the ScopeOfPolicyExemption property. For example:

    Get-Gpo -All | Select-Object ScopeOfPolicyExemption

    This will output the scope of policy exemption for all GPOs.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.