Search code examples
windowspowershellactive-directorygpodomaincontroller

How to get Client Side Extension (CSE) GUID of a policy area and MMC snap-in GUID of that same policy area?


I am trying to implement a GPO "Preference" without a domain according to this guide: https://sdmsoftware.com/tips-tricks/group-policy-preferences-in-the-local-gpo-yes/ and since I am not that experienced with GPOs, I dont know how to get those Client Side Extension (CSE) GUID and MMC snap-in GUID pairs for a specific GPO Preference (One drive mapping). In the comments is suggested using "a LDAP query in PowerShell (where the GUID is the GPO one) :

$Object = [adsi]’LDAP://cn={b13e3fa8-6ca2-47fb-8a99-7d8445b1d44b},cn=policies,cn=system,DC=domain,DC=com’
$Object.gPCUserExtensionNames

But when I put that into my PS it throws an error and I probably have to adjust something, but I am pretty clueless about it. So since I cannot comment on the original post for some reason, I ask here, how to get the rigth gpt.ini?

At this point I am far enough to have generated the actual GPO and I just have to update the gpt.ini but I dont know how.


Solution

  • Try this:

    $gpoPath = get-gpo -Name "Test - GPO" | select -ExpandProperty Path
    
    $object = [adsi]"LDAP://$gpoPath"
    $object.gPCUserExtensionNames