Power ShellSCCMScripts

Disable Dual Scan

I recently was working on an issue where device gets its software updates from Microsoft (windows update) which i didn’t wanted this way. After troubleshooting, i found that the registry key needs to be changed in order devices looks for updates from WSUS.

to check where the devices gets its update use this cmd.

$MUSM = New-Object -ComObject "Microsoft.Update.ServiceManager"
$status = $MUSM.Services 
$status | select name, IsDefaultAUService

if you run this powershell cmd, you will see that “windows update” shows “True”

If you open the Registry with path “Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate”  you will see the “DisableDualScan” value is “0”.

To fix the issue, either change the value to “1” manually or use this powershell script to change value to “1”

#############################################################
############### this logic first check if key disabledualscan exist then update the value to 1, if key not exist then it will create it with value 1

$path = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
$disableDualScan = get-itemproperty -path "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name 'DisableDualScan'


 if (test-path $path) {
      if($DisableDualScan){
            Set-Itemproperty -path "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name 'DisableDualScan' -value 1
  
      }else {
        New-Itemproperty -path "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -PropertyType Dword -Name 'DisableDualScan' -value 1

     }
}

############################################################################################################
############## the one line cmdlet create the key or update the key to value 1

Set-Itemproperty -path "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name 'DisableDualScan' -value 1 -Verbose



###########################################################################################################

 

AFter you apply the fix then run again the cmd to check what is the status

$MUSM = New-Object -ComObject "Microsoft.Update.ServiceManager"
$status = $MUSM.Services 
$status | select name, IsDefaultAUService

 

You will see the result shows “Windows server update service = True ”

Now the device will always look for WSUS to gets its software updates and being manage by WSUS.

 

 

 

Show More

Related Articles

Back to top button