How to edit local group policy objects via command line?












0















Is there a way to change or edit certain group policies via command line?



We are currently installing a lot of PCs based on an image. After the install is done, certain group policies need to be changed, which we have to do manually at this point.



I Would like to add these changes in a script so I can create a script per department to enforce these group policies.



For example:
Set "Computer Configuration / Management Templates / Configuration Panel / Online Tooltips" to "disabled" via a script.



Thanks!










share|improve this question























  • Take a look at this other question. It might address your need. superuser.com/questions/365699/…

    – Doug Deden
    Jan 23 at 15:27











  • Why aren't you deploying group policies via Active Directory?

    – grawity
    Jan 23 at 15:31






  • 1





    Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

    – Joe
    Jan 24 at 10:12













  • @Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

    – grawity
    Jan 24 at 12:07











  • @grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

    – Joe
    Jan 25 at 13:04
















0















Is there a way to change or edit certain group policies via command line?



We are currently installing a lot of PCs based on an image. After the install is done, certain group policies need to be changed, which we have to do manually at this point.



I Would like to add these changes in a script so I can create a script per department to enforce these group policies.



For example:
Set "Computer Configuration / Management Templates / Configuration Panel / Online Tooltips" to "disabled" via a script.



Thanks!










share|improve this question























  • Take a look at this other question. It might address your need. superuser.com/questions/365699/…

    – Doug Deden
    Jan 23 at 15:27











  • Why aren't you deploying group policies via Active Directory?

    – grawity
    Jan 23 at 15:31






  • 1





    Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

    – Joe
    Jan 24 at 10:12













  • @Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

    – grawity
    Jan 24 at 12:07











  • @grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

    – Joe
    Jan 25 at 13:04














0












0








0








Is there a way to change or edit certain group policies via command line?



We are currently installing a lot of PCs based on an image. After the install is done, certain group policies need to be changed, which we have to do manually at this point.



I Would like to add these changes in a script so I can create a script per department to enforce these group policies.



For example:
Set "Computer Configuration / Management Templates / Configuration Panel / Online Tooltips" to "disabled" via a script.



Thanks!










share|improve this question














Is there a way to change or edit certain group policies via command line?



We are currently installing a lot of PCs based on an image. After the install is done, certain group policies need to be changed, which we have to do manually at this point.



I Would like to add these changes in a script so I can create a script per department to enforce these group policies.



For example:
Set "Computer Configuration / Management Templates / Configuration Panel / Online Tooltips" to "disabled" via a script.



Thanks!







command-line script






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 23 at 15:24









JoeJoe

33




33













  • Take a look at this other question. It might address your need. superuser.com/questions/365699/…

    – Doug Deden
    Jan 23 at 15:27











  • Why aren't you deploying group policies via Active Directory?

    – grawity
    Jan 23 at 15:31






  • 1





    Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

    – Joe
    Jan 24 at 10:12













  • @Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

    – grawity
    Jan 24 at 12:07











  • @grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

    – Joe
    Jan 25 at 13:04



















  • Take a look at this other question. It might address your need. superuser.com/questions/365699/…

    – Doug Deden
    Jan 23 at 15:27











  • Why aren't you deploying group policies via Active Directory?

    – grawity
    Jan 23 at 15:31






  • 1





    Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

    – Joe
    Jan 24 at 10:12













  • @Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

    – grawity
    Jan 24 at 12:07











  • @grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

    – Joe
    Jan 25 at 13:04

















Take a look at this other question. It might address your need. superuser.com/questions/365699/…

– Doug Deden
Jan 23 at 15:27





Take a look at this other question. It might address your need. superuser.com/questions/365699/…

– Doug Deden
Jan 23 at 15:27













Why aren't you deploying group policies via Active Directory?

– grawity
Jan 23 at 15:31





Why aren't you deploying group policies via Active Directory?

– grawity
Jan 23 at 15:31




1




1





Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

– Joe
Jan 24 at 10:12







Thanks for all suggestions! @grawity: We are deploying group policies via Active Directory, but some policies are only needed temporarily during installation.

– Joe
Jan 24 at 10:12















@Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

– grawity
Jan 24 at 12:07





@Joe: Then I'd still stick with AD GPO but e.g. use security filtering so that it only applies to computers within a specific group.

– grawity
Jan 24 at 12:07













@grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

– Joe
Jan 25 at 13:04





@grawity: I don't know what you mean. I meant that there are policies which we need to enable, only to disable them half an hour later on. Surely using AD for such a situation would be less convenient than running a script with an enable/disable in it?

– Joe
Jan 25 at 13:04










2 Answers
2






active

oldest

votes


















0














Since the Group Policy settings are stored in the Registry, the easiest method to create department-wide configurations might be through a .reg file,



Microsoft maintains a list of the Group Policy Registry keys. For example, line 188 shows HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer!AllowOnlineTips controls online tooltips.



Rather than synthesizing the .reg script from scratch, you could "reverse engineer" such a script by taking a snapshot of the Registry of a freshly created clone, applying appropriate changes through the Group Policy Editor, and then diffing that snapshot with a new one. An excellent tool for this purpose is Nirsoft's RegistryChangesView, which can "export the Registry changes into a standard .reg file".



Of course, if you're running a batch script anyway, just add a line to it:



regedit.exe /s "full path to your .reg file"



You can also import .reg files through the GPE using PowerShell.






share|improve this answer































    0














    Yes, it is possible by a powershell script, I find out here a descriptive way to manage Local Policy with powershell.



    If I can suggest you another approach why do not edit the image and deploy the image with the configuration you likes?



    If you cannot edit the image because a third party provide it to you, you can restore it in a computer, perform your personalisation and create an image to restore on other computers with opensource tools like clonezilla.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397521%2fhow-to-edit-local-group-policy-objects-via-command-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Since the Group Policy settings are stored in the Registry, the easiest method to create department-wide configurations might be through a .reg file,



      Microsoft maintains a list of the Group Policy Registry keys. For example, line 188 shows HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer!AllowOnlineTips controls online tooltips.



      Rather than synthesizing the .reg script from scratch, you could "reverse engineer" such a script by taking a snapshot of the Registry of a freshly created clone, applying appropriate changes through the Group Policy Editor, and then diffing that snapshot with a new one. An excellent tool for this purpose is Nirsoft's RegistryChangesView, which can "export the Registry changes into a standard .reg file".



      Of course, if you're running a batch script anyway, just add a line to it:



      regedit.exe /s "full path to your .reg file"



      You can also import .reg files through the GPE using PowerShell.






      share|improve this answer




























        0














        Since the Group Policy settings are stored in the Registry, the easiest method to create department-wide configurations might be through a .reg file,



        Microsoft maintains a list of the Group Policy Registry keys. For example, line 188 shows HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer!AllowOnlineTips controls online tooltips.



        Rather than synthesizing the .reg script from scratch, you could "reverse engineer" such a script by taking a snapshot of the Registry of a freshly created clone, applying appropriate changes through the Group Policy Editor, and then diffing that snapshot with a new one. An excellent tool for this purpose is Nirsoft's RegistryChangesView, which can "export the Registry changes into a standard .reg file".



        Of course, if you're running a batch script anyway, just add a line to it:



        regedit.exe /s "full path to your .reg file"



        You can also import .reg files through the GPE using PowerShell.






        share|improve this answer


























          0












          0








          0







          Since the Group Policy settings are stored in the Registry, the easiest method to create department-wide configurations might be through a .reg file,



          Microsoft maintains a list of the Group Policy Registry keys. For example, line 188 shows HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer!AllowOnlineTips controls online tooltips.



          Rather than synthesizing the .reg script from scratch, you could "reverse engineer" such a script by taking a snapshot of the Registry of a freshly created clone, applying appropriate changes through the Group Policy Editor, and then diffing that snapshot with a new one. An excellent tool for this purpose is Nirsoft's RegistryChangesView, which can "export the Registry changes into a standard .reg file".



          Of course, if you're running a batch script anyway, just add a line to it:



          regedit.exe /s "full path to your .reg file"



          You can also import .reg files through the GPE using PowerShell.






          share|improve this answer













          Since the Group Policy settings are stored in the Registry, the easiest method to create department-wide configurations might be through a .reg file,



          Microsoft maintains a list of the Group Policy Registry keys. For example, line 188 shows HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer!AllowOnlineTips controls online tooltips.



          Rather than synthesizing the .reg script from scratch, you could "reverse engineer" such a script by taking a snapshot of the Registry of a freshly created clone, applying appropriate changes through the Group Policy Editor, and then diffing that snapshot with a new one. An excellent tool for this purpose is Nirsoft's RegistryChangesView, which can "export the Registry changes into a standard .reg file".



          Of course, if you're running a batch script anyway, just add a line to it:



          regedit.exe /s "full path to your .reg file"



          You can also import .reg files through the GPE using PowerShell.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 23 at 15:54









          DrMoishe PippikDrMoishe Pippik

          10.2k21432




          10.2k21432

























              0














              Yes, it is possible by a powershell script, I find out here a descriptive way to manage Local Policy with powershell.



              If I can suggest you another approach why do not edit the image and deploy the image with the configuration you likes?



              If you cannot edit the image because a third party provide it to you, you can restore it in a computer, perform your personalisation and create an image to restore on other computers with opensource tools like clonezilla.






              share|improve this answer




























                0














                Yes, it is possible by a powershell script, I find out here a descriptive way to manage Local Policy with powershell.



                If I can suggest you another approach why do not edit the image and deploy the image with the configuration you likes?



                If you cannot edit the image because a third party provide it to you, you can restore it in a computer, perform your personalisation and create an image to restore on other computers with opensource tools like clonezilla.






                share|improve this answer


























                  0












                  0








                  0







                  Yes, it is possible by a powershell script, I find out here a descriptive way to manage Local Policy with powershell.



                  If I can suggest you another approach why do not edit the image and deploy the image with the configuration you likes?



                  If you cannot edit the image because a third party provide it to you, you can restore it in a computer, perform your personalisation and create an image to restore on other computers with opensource tools like clonezilla.






                  share|improve this answer













                  Yes, it is possible by a powershell script, I find out here a descriptive way to manage Local Policy with powershell.



                  If I can suggest you another approach why do not edit the image and deploy the image with the configuration you likes?



                  If you cannot edit the image because a third party provide it to you, you can restore it in a computer, perform your personalisation and create an image to restore on other computers with opensource tools like clonezilla.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 23 at 15:34









                  AtomiX84AtomiX84

                  4779




                  4779






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397521%2fhow-to-edit-local-group-policy-objects-via-command-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido