4 Replies Latest reply on Dec 5, 2018 10:24 AM by vin01

    Local gp are not applying on windows machines

    vin01 Hot Shot

      This is a windows based question sorry to post here. Can someone help me to fix this if possible as i am trying to apply on multiple machines using invoke-vmscript

       

      I can able to set wusserver configuration in registry using set-itemproperty cmdlet but this is not reflecting in group policies even after reboot.

      $wsusclientserver='LIBPRO27.LIBPOC.COM'
      $defaultwindowssettings= @'
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate" -Name "WUServer" -Value "https://$($wsusclientserver):80"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate" -Name "WUStatusServer" -Value "https://$($wsusclientserver):80"
      Get-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Value "0"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Value "3"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "ScheduledInstallDay" -Value "0"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "ScheduledInstallTime" -Value "3"
      Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value "1" 
      '@
      $defaultwindowssettingssub = $ExecutionContext.InvokeCommand.ExpandString($defaultwindowssettings) 
      Invoke-VMScript -VM vm01 -GuestUser administrator -GuestPassword password -ScriptType Powershell -ScriptText $defaultwindowssettingssub
      

       

      Output after execution:

      Regards
      Vineeth.K