How to add QOS to Local Computer Policy with Powershell












0














I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local?



#Create QOS for RDP Session
#Create a new Group Policy Object (GPO) that will be applied to the LocalHost that contain the computer objects.
#The value "Teams client - QoS" can be modified to fit your needs or naming standards
New-GPO "Local Computer Policy" -Name "MSTSC" -Comment "QoS for Agents."

#Create Registry Value for Teams client Audio QoS in the "Teams Client - QoS" GPO
Set-GPRegistryValue -Name "MSTSC" -Key "HKLMSOFTWAREPoliciesMicrosoftWindowsQoSMSTSC" -ValueName "Application Name", "DSCP Value", "Local IP", "Local IP Prefix Length", "Local Port", "Protocol", "Remote IP", "Remote IP Prefix Length", "Remote Port", "Throttle Rate", Version -Type String -Value "mstsc.exe", "0", "*", "*", "*", "*", "*", "*", "*", "-1", "1.0"









share|improve this question





























    0














    I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local?



    #Create QOS for RDP Session
    #Create a new Group Policy Object (GPO) that will be applied to the LocalHost that contain the computer objects.
    #The value "Teams client - QoS" can be modified to fit your needs or naming standards
    New-GPO "Local Computer Policy" -Name "MSTSC" -Comment "QoS for Agents."

    #Create Registry Value for Teams client Audio QoS in the "Teams Client - QoS" GPO
    Set-GPRegistryValue -Name "MSTSC" -Key "HKLMSOFTWAREPoliciesMicrosoftWindowsQoSMSTSC" -ValueName "Application Name", "DSCP Value", "Local IP", "Local IP Prefix Length", "Local Port", "Protocol", "Remote IP", "Remote IP Prefix Length", "Remote Port", "Throttle Rate", Version -Type String -Value "mstsc.exe", "0", "*", "*", "*", "*", "*", "*", "*", "-1", "1.0"









    share|improve this question



























      0












      0








      0







      I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local?



      #Create QOS for RDP Session
      #Create a new Group Policy Object (GPO) that will be applied to the LocalHost that contain the computer objects.
      #The value "Teams client - QoS" can be modified to fit your needs or naming standards
      New-GPO "Local Computer Policy" -Name "MSTSC" -Comment "QoS for Agents."

      #Create Registry Value for Teams client Audio QoS in the "Teams Client - QoS" GPO
      Set-GPRegistryValue -Name "MSTSC" -Key "HKLMSOFTWAREPoliciesMicrosoftWindowsQoSMSTSC" -ValueName "Application Name", "DSCP Value", "Local IP", "Local IP Prefix Length", "Local Port", "Protocol", "Remote IP", "Remote IP Prefix Length", "Remote Port", "Throttle Rate", Version -Type String -Value "mstsc.exe", "0", "*", "*", "*", "*", "*", "*", "*", "-1", "1.0"









      share|improve this question















      I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local?



      #Create QOS for RDP Session
      #Create a new Group Policy Object (GPO) that will be applied to the LocalHost that contain the computer objects.
      #The value "Teams client - QoS" can be modified to fit your needs or naming standards
      New-GPO "Local Computer Policy" -Name "MSTSC" -Comment "QoS for Agents."

      #Create Registry Value for Teams client Audio QoS in the "Teams Client - QoS" GPO
      Set-GPRegistryValue -Name "MSTSC" -Key "HKLMSOFTWAREPoliciesMicrosoftWindowsQoSMSTSC" -ValueName "Application Name", "DSCP Value", "Local IP", "Local IP Prefix Length", "Local Port", "Protocol", "Remote IP", "Remote IP Prefix Length", "Remote Port", "Throttle Rate", Version -Type String -Value "mstsc.exe", "0", "*", "*", "*", "*", "*", "*", "*", "-1", "1.0"






      powershell script shell-script group-policy qos






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 14 '18 at 19:29









      Ahmed Ashour

      1,068610




      1,068610










      asked Dec 14 '18 at 19:03









      James

      53




      53






















          2 Answers
          2






          active

          oldest

          votes


















          0














          As for this..




          'makes a domain GPO policy and not a local one'




          this is by design. There are no cmdlets for local GPO native in PowerShell so, either you have to write this yourself, or use this module



          PolicyFileEditor:



          See this article on it's use: How to manage Local Group Policy with Powershell




          This module can be used to manage your local policies, but it can also
          be used to get the policies from Policy templates. An example would be
          the policy templates shipped with Security Compliance Manager. If you
          also want to set a baseline for your Local policies, you can use this
          module to compare your live policies to the ones in the templates. It
          is then very easy to go back and make a single change if a policy
          changes. In the screenshot below you can see the output of
          Get-PolicyFileEntry for a SCM Windows 10 User Policy.







          share|improve this answer





























            0














            I wasn't able to put it in GPO but i was able to add it to the Registry



            # Setup QOS on MSTSC session

            # Works but doesn't show up in GPO Editor
            #reg import .MSTSC.reg

            # Works but doesn't show up in GPO Editor
            # Invoke-Command {reg import .MSTSC.reg *>&1}

            # Works but doesn't show up in GPO Editor
            $StartParams = @{
            FilePath = "$Env:SystemRootREGEDIT.exe"
            ArgumentList = '/s','.MSTSC.reg'
            Verb = 'RunAs'
            PassThru = $True
            Wait = $True
            }
            $Proc = Start-Process @StartParams

            If ($Proc.ExitCode -eq 0) { Write-Host 'Success!' }
            Else { Write-Host "Fail! Exit code: $($Proc.ExitCode)" }

            Pause





            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%2f1383661%2fhow-to-add-qos-to-local-computer-policy-with-powershell%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














              As for this..




              'makes a domain GPO policy and not a local one'




              this is by design. There are no cmdlets for local GPO native in PowerShell so, either you have to write this yourself, or use this module



              PolicyFileEditor:



              See this article on it's use: How to manage Local Group Policy with Powershell




              This module can be used to manage your local policies, but it can also
              be used to get the policies from Policy templates. An example would be
              the policy templates shipped with Security Compliance Manager. If you
              also want to set a baseline for your Local policies, you can use this
              module to compare your live policies to the ones in the templates. It
              is then very easy to go back and make a single change if a policy
              changes. In the screenshot below you can see the output of
              Get-PolicyFileEntry for a SCM Windows 10 User Policy.







              share|improve this answer


























                0














                As for this..




                'makes a domain GPO policy and not a local one'




                this is by design. There are no cmdlets for local GPO native in PowerShell so, either you have to write this yourself, or use this module



                PolicyFileEditor:



                See this article on it's use: How to manage Local Group Policy with Powershell




                This module can be used to manage your local policies, but it can also
                be used to get the policies from Policy templates. An example would be
                the policy templates shipped with Security Compliance Manager. If you
                also want to set a baseline for your Local policies, you can use this
                module to compare your live policies to the ones in the templates. It
                is then very easy to go back and make a single change if a policy
                changes. In the screenshot below you can see the output of
                Get-PolicyFileEntry for a SCM Windows 10 User Policy.







                share|improve this answer
























                  0












                  0








                  0






                  As for this..




                  'makes a domain GPO policy and not a local one'




                  this is by design. There are no cmdlets for local GPO native in PowerShell so, either you have to write this yourself, or use this module



                  PolicyFileEditor:



                  See this article on it's use: How to manage Local Group Policy with Powershell




                  This module can be used to manage your local policies, but it can also
                  be used to get the policies from Policy templates. An example would be
                  the policy templates shipped with Security Compliance Manager. If you
                  also want to set a baseline for your Local policies, you can use this
                  module to compare your live policies to the ones in the templates. It
                  is then very easy to go back and make a single change if a policy
                  changes. In the screenshot below you can see the output of
                  Get-PolicyFileEntry for a SCM Windows 10 User Policy.







                  share|improve this answer












                  As for this..




                  'makes a domain GPO policy and not a local one'




                  this is by design. There are no cmdlets for local GPO native in PowerShell so, either you have to write this yourself, or use this module



                  PolicyFileEditor:



                  See this article on it's use: How to manage Local Group Policy with Powershell




                  This module can be used to manage your local policies, but it can also
                  be used to get the policies from Policy templates. An example would be
                  the policy templates shipped with Security Compliance Manager. If you
                  also want to set a baseline for your Local policies, you can use this
                  module to compare your live policies to the ones in the templates. It
                  is then very easy to go back and make a single change if a policy
                  changes. In the screenshot below you can see the output of
                  Get-PolicyFileEntry for a SCM Windows 10 User Policy.








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 14 '18 at 23:40









                  postanote

                  92023




                  92023

























                      0














                      I wasn't able to put it in GPO but i was able to add it to the Registry



                      # Setup QOS on MSTSC session

                      # Works but doesn't show up in GPO Editor
                      #reg import .MSTSC.reg

                      # Works but doesn't show up in GPO Editor
                      # Invoke-Command {reg import .MSTSC.reg *>&1}

                      # Works but doesn't show up in GPO Editor
                      $StartParams = @{
                      FilePath = "$Env:SystemRootREGEDIT.exe"
                      ArgumentList = '/s','.MSTSC.reg'
                      Verb = 'RunAs'
                      PassThru = $True
                      Wait = $True
                      }
                      $Proc = Start-Process @StartParams

                      If ($Proc.ExitCode -eq 0) { Write-Host 'Success!' }
                      Else { Write-Host "Fail! Exit code: $($Proc.ExitCode)" }

                      Pause





                      share|improve this answer


























                        0














                        I wasn't able to put it in GPO but i was able to add it to the Registry



                        # Setup QOS on MSTSC session

                        # Works but doesn't show up in GPO Editor
                        #reg import .MSTSC.reg

                        # Works but doesn't show up in GPO Editor
                        # Invoke-Command {reg import .MSTSC.reg *>&1}

                        # Works but doesn't show up in GPO Editor
                        $StartParams = @{
                        FilePath = "$Env:SystemRootREGEDIT.exe"
                        ArgumentList = '/s','.MSTSC.reg'
                        Verb = 'RunAs'
                        PassThru = $True
                        Wait = $True
                        }
                        $Proc = Start-Process @StartParams

                        If ($Proc.ExitCode -eq 0) { Write-Host 'Success!' }
                        Else { Write-Host "Fail! Exit code: $($Proc.ExitCode)" }

                        Pause





                        share|improve this answer
























                          0












                          0








                          0






                          I wasn't able to put it in GPO but i was able to add it to the Registry



                          # Setup QOS on MSTSC session

                          # Works but doesn't show up in GPO Editor
                          #reg import .MSTSC.reg

                          # Works but doesn't show up in GPO Editor
                          # Invoke-Command {reg import .MSTSC.reg *>&1}

                          # Works but doesn't show up in GPO Editor
                          $StartParams = @{
                          FilePath = "$Env:SystemRootREGEDIT.exe"
                          ArgumentList = '/s','.MSTSC.reg'
                          Verb = 'RunAs'
                          PassThru = $True
                          Wait = $True
                          }
                          $Proc = Start-Process @StartParams

                          If ($Proc.ExitCode -eq 0) { Write-Host 'Success!' }
                          Else { Write-Host "Fail! Exit code: $($Proc.ExitCode)" }

                          Pause





                          share|improve this answer












                          I wasn't able to put it in GPO but i was able to add it to the Registry



                          # Setup QOS on MSTSC session

                          # Works but doesn't show up in GPO Editor
                          #reg import .MSTSC.reg

                          # Works but doesn't show up in GPO Editor
                          # Invoke-Command {reg import .MSTSC.reg *>&1}

                          # Works but doesn't show up in GPO Editor
                          $StartParams = @{
                          FilePath = "$Env:SystemRootREGEDIT.exe"
                          ArgumentList = '/s','.MSTSC.reg'
                          Verb = 'RunAs'
                          PassThru = $True
                          Wait = $True
                          }
                          $Proc = Start-Process @StartParams

                          If ($Proc.ExitCode -eq 0) { Write-Host 'Success!' }
                          Else { Write-Host "Fail! Exit code: $($Proc.ExitCode)" }

                          Pause






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered yesterday









                          James

                          53




                          53






























                              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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2f1383661%2fhow-to-add-qos-to-local-computer-policy-with-powershell%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

                              "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                              Alcedinidae

                              RAC Tourist Trophy