none
IGroupPolicyObject Save Method

    Question

  • Hi all,

    I am modifying few registry based gpo settings and saving it programmatically. When using Save method in IGroupPolicyObject, what is the guid that should be passed as the 4th arg? Msdn says, pass the guid of snapin. But am not using any snapin to save. What i want to pass is the same guid of GPMC snap in itself. Is that allowed? If yes, where i can find the guid of GPMC to use in save method. If i should not use group policy mangement console's guid, what guid i should use?

    Note: Am not talking about 3rd arg, which is also a guid, but i should use REGISTRY_EXTENSION_GUID there, since am modifying registry based settings.

    (IGroupPolicyObject Save method msdn)



    • Edited by Routine User Monday, March 7, 2016 10:02 AM updated link
    Monday, March 7, 2016 8:16 AM

Answers

  • > {0F6B957D-509E-11D1-A7CC-0000F87571E3} - ADMComputers_1 - Administrative
    > Templates (XP / 2003)
    > {0F6B957E-509E-11D1-A7CC-0000F87571E3} - ADMUsers_1 - Administrative
    > Templates (XP / 2003)
    >
    >
    > {B6F9C8AE-EF3A-41C8-A911-37370C331DD4} - ADMComputers_2 - Administrative
    > Templates - RSoP
    > {B6F9C8AF-EF3A-41C8-A911-37370C331DD4} - ADMUsers_2 - Administrative
    > Templates - RSoP
    >
    > *Can you kindly clarify me, when i should use which user related guid
    > out of the three user related guids mentioned?*
     
    The following one - that's the SnapIn GUID for ADM Templates in user
    configuration starting with Vista:
     
    {D02B1F73-3407-48AE-BA88-E8213C6761F1}     ADMUsers_3 - Administrative
    Vorlagen (Win6/Win7)
     
    And for the sake of completeness: This is the CSE GUID for
    administrative templates aka "Registry":
     
    {35378EAC-683F-11D2-A89A-00C04FBBCFA2}
     
    Monday, March 7, 2016 11:36 AM

All replies

  • > the guid that should be passed as the 4th arg. Msdn says pass the guid
    > of snapin. But am not using any snapin.
     
    No, but the snapin is the part responsible for accessing your data.
    Here's a list of all CSE GUIds and all Snapin GUIDs. German, but google
    can assist :)
     
     
    If I understand correctly, these are the ones you are looking for:
    {D02B1F72-3407-48AE-BA88-E8213C6761F1}     ADMComputers_3 - Administrative
    Vorlagen (Win6/Win7)
    {D02B1F73-3407-48AE-BA88-E8213C6761F1}     ADMUsers_3 - Administrative
    Vorlagen (Win6/Win7)
     
    Monday, March 7, 2016 9:33 AM
  • Hi Martin Binder,

    But the msdn says regarding the 4th argument guid as:

    pGuid [in]

    Specifies the GUID that identifies the MMC snap-in used to edit this policy. The snap-in can be a Microsoft snap-in or a third-party snap-in.

    I used REGISTRY_EXTENSION_GUID as third argument as the msdn says below for 3rd argument.

    pGuidExtension [in]

    Specifies the GUID or unique name of the snap-in extension that will process policy. If the GPO is to be processed by the snap-in that processes .pol files, you must specify the REGISTRY_EXTENSION_GUID value.


    Monday, March 7, 2016 10:06 AM
  • Hi Martin,

    I think I should use the two guids you specified according to the type of registry based settings i try to save (user / computer). Correct?

    Another doubt is,

    I found the following related guids in the link you mentioned.

    {0F6B957D-509E-11D1-A7CC-0000F87571E3} - ADMComputers_1 - Administrative Templates (XP / 2003)
    {0F6B957E-509E-11D1-A7CC-0000F87571E3} - ADMUsers_1 - Administrative Templates (XP / 2003)


    {B6F9C8AE-EF3A-41C8-A911-37370C331DD4} - ADMComputers_2 - Administrative Templates - RSoP
    {B6F9C8AF-EF3A-41C8-A911-37370C331DD4} - ADMUsers_2 - Administrative Templates - RSoP

    Can you kindly clarify me, when i should use which user related guid out of the three user related guids mentioned?


    • Edited by Routine User Monday, March 7, 2016 10:53 AM updated text
    Monday, March 7, 2016 10:51 AM
  • > {0F6B957D-509E-11D1-A7CC-0000F87571E3} - ADMComputers_1 - Administrative
    > Templates (XP / 2003)
    > {0F6B957E-509E-11D1-A7CC-0000F87571E3} - ADMUsers_1 - Administrative
    > Templates (XP / 2003)
    >
    >
    > {B6F9C8AE-EF3A-41C8-A911-37370C331DD4} - ADMComputers_2 - Administrative
    > Templates - RSoP
    > {B6F9C8AF-EF3A-41C8-A911-37370C331DD4} - ADMUsers_2 - Administrative
    > Templates - RSoP
    >
    > *Can you kindly clarify me, when i should use which user related guid
    > out of the three user related guids mentioned?*
     
    The following one - that's the SnapIn GUID for ADM Templates in user
    configuration starting with Vista:
     
    {D02B1F73-3407-48AE-BA88-E8213C6761F1}     ADMUsers_3 - Administrative
    Vorlagen (Win6/Win7)
     
    And for the sake of completeness: This is the CSE GUID for
    administrative templates aka "Registry":
     
    {35378EAC-683F-11D2-A89A-00C04FBBCFA2}
     
    Monday, March 7, 2016 11:36 AM