PowerTip: Use PowerShell to Get a Listing of All GPOs in a Domain

PowerTip: Use PowerShell to Get a Listing of All GPOs in a Domain

  • Comments 3
  • Likes

Summary: Use a Windows PowerShell cmdlet from the RSAT tools to display all GPOs defined in a domain.

Hey, Scripting Guy! Question How can I get a listing of all the GPOs defined in my domain?

Hey, Scripting Guy! Answer Use the Get-GPO cmdlet from the RSAT tools. Instead of specifying a GPO name or GUID, use the –all switch, as shown here.

Get-GPO -all

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Hi,

    This will only list GPO where you have at least read access.

    In my environment, I have a Group Policy that targets only active directory computer objects that has some security permissions that prevents domain users from reading it.

    I get only all the GPO if I execute the above cmdlet with Domain Admin credentials.

  • @_Emin_ You are correct, PowerShell does not bypass security, and if you do not have permissions to the GPO you will not be able to correctly run the command. You can launch PowerShell using runas with the appropriate credentials, or use PowerShell remoting and create a session with the appropriate permissions.

  • Great post from your hands again. I loved the complete article.
    By the way nice writing style you have. I never felt like boring while reading this article.
    I will come back & read all your posts soon. Regards, Lucy.