registrery.pol gpo powehell

olivier-rb 91 Reputation points
2021-01-02T09:47:08.79+00:00

Hello
when creating gpo in powershell, the register.pol file is created with the values of the registry used for the startegy.
but do not include the registry key that activates this policy.
How to activate in the group strategy editor.
example: clearing the list of programs must be enabled so that the registry.pol is the registered key.
or how to modify the registry.pol what is the format because with notpad I have elements that I do not understand.

Thank you for your help

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-01-05T13:31:55.383+00:00

    Hi,

    See if this works. I suppose the disallowed items in the gpo TestGPO are Windows Firewall and Windows Defender.

    Set-GPRegistryValue -Name TestGPO -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -ValueName DisallowCpl -Type DWord -Value 1  
    Set-GPRegistryValue -Name TestGPO -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowCpl" -ValueName 1 -Type String  -Value "Windows Firewall"  
    Set-GPRegistryValue -Name TestGPO -Key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowCpl" -ValueName 2 -Type String  -Value "Windows Defender"  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. olivier-rb 91 Reputation points
    2021-01-02T09:58:26.037+00:00

    regestery.pol with enabled

    PReg [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r ; D i s a l l o w C p l ; ; ; ] [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r \ D i s a l l o w C p l ; 1 ; ; " ; P a r e - f e u W i n d o w s ]

    0 comments No comments

  2. olivier-rb 91 Reputation points
    2021-01-04T09:29:52.473+00:00

    hi

    anybody

    juste want to use powershell to create correctelly an gpo with right .pol.br

    0 comments No comments

  3. olivier-rb 91 Reputation points
    2021-01-04T20:01:25.253+00:00

    gpo created with gpo

    53383-capture-decran-2021-01-04-204203.png

    but in gp editor is not configured
    53354-capture-decran-2021-01-04-204112.png

    and the registery.pol like this:

    PReg [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r \ D i s a l l o w C p l ; 1 ; ; " ; P a r e - f e u W i n d o w s ]
    and normaly if enabled is checked:
    PReg [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r ; D i s a l l o w C p l ; ; ; ] [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r \ D i s a l l o w C p l ; * * d e l v a l s . ; ; ; ] [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r \ D i s a l l o w C p l ; 1 ; ; " ; P a r e - f e u W i n d o w s ]

    and when the client read registry.pol , only this key is create in regedit ( S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r \ D i s a l l o w C p l ; 1 ; ; " ; P a r e - f e u W i n d )
    and not this key
    [ S O F T W A R E \ M i c r o s o f t \ W i n d o w s \ C u r r e n t V e r s i o n \ P o l i c i e s \ E x p l o r e r ; D i s a l l o w C p l ; ; ; ]

    and the gpo dont work.

    my question is :
    how to enabled paramètre

    thank you

    0 comments No comments

  4. Anonymous
    2021-01-05T02:52:27.16+00:00

    Hi,

    Try configuring policy settings in the GPO with Set-GPRegistryValue.

    Set-GPRegistryValue -Name $GPO -Key "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -ValueName "NoControlPanel" -Type DWORD -Value 1  
    

    Set-GPRegistryValue

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.