14

I'm monitoring ad logs, when someone modify an AD Object, I could see a log, but only the GUID of that Group Policy was provided in the line.

So given an GUID of a Group Policy, is it possible to get the name that was displayed in gpmc.msc? (I mean to use LDAP protocol to get that)

6 Answers 6

10

LDAP? That guid is an attribute on an object in Active Directory, so yes you can query for it:

(&(objectCategory=groupPolicyContainer)(name={D45A4D0F-77BE-4116-9F5B-CF96E81D2DDC}))  

LDAP query example

You can also search for that value in the Group Policy Management Console:

enter image description here

1
  • 1
    Yep, this works great with dsquery as well: dsquery * -filter "(objectCategory=groupPolicyContainer)" -attr displayName objectGUID -limit 0
    – jscott
    Dec 27, 2012 at 19:38
18

You can use PowerShell's Get-GPO cmdlet for this. It contains a -GUID switch, which is what you want to use here. You also need to have the AD Commandline Tools from RSAT installed so that you have access to the Group Policy module. If you use the AD module, you have this installed already.

The example in the linked article is:

Import-Module GroupPolicy
Get-GPO -Guid 31a09564-cd4a-4520-98fa-446a2af23b4b -Domain sales.contoso.com
0
3

Sure. Open Group Policy Management. Navigate to a GPO. Click on the Details tab for that GPO. Look at the Unique ID property.

gpo

2
  • -1 because while that will work nobody wants to look at every item in an attempt to find the name for that GUID. Dec 27, 2012 at 22:01
  • 1
    It's useful information. It's not the most efficient way to find a single specific GUID in a domain, but there are situations in which this could be helpful, especially if you already suspect a specific GPO, or if you are looking to cross-reference a specific GPO in a gpresult, for instance.
    – Daniel
    Sep 25, 2016 at 0:42
2

This script allows you to enumerate all the GPOs in your Active Directory domain and get their names, GUIDs and SIDs.

$gpolist = Get-QADObject -Type groupPolicyContainer
foreach ($objResult in $gpolist) {
    Write-Host $objResult.name ";" $objResult.GUID ";" $objResult.displayname
}

And moreover you can refer these links also.

http://techibee.com/group-policies/resolve-gpo-guid-to-gpo-name/169

http://www.howtonetworking.com/grouppolicy/grouppolicy3.htm

Hope it helps for you.

2
  • 1
    You should note that this requires the Qwest AD cmdlets and link to them. People that don't know will read this and wonder why it doesn't work on their machine.
    – MDMarra
    Dec 27, 2012 at 12:19
  • You may find the Format-Table or ConvertTo-Csv cmdlets easier to work with than manually formatting with Write-Host.
    – jscott
    Dec 27, 2012 at 19:42
0

This simple PowerShell will export a list of all your domain GPOs with GUID to a .csv.

Get-GPO -All internal.example.com | Export-CSV C:\somefolder\file.csv
0

You can see all the GPOs with their GUIDs here

Import-Module GroupPolicy
Get-GPO -All | ogv

Enter any of the text you're looking for (such as GUID) in the filter box to narrow down the results. Instead of -ALL use the GUID to just get the details on the one GUID that you're interested in, or pipe through select and where instead of ogv to narrow down the results in powershell.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .