Intune Proactive Remediation of how to set Visual Studio to Auto Update

**Update**

Go figure they just released an Intune update ( 2305 ) to do this natively !

Configure Visual Studio Install And Update Settings Using Intune HTMD Blog (anoopcnair.com)

#Check
#Function to Check Registry Value 

Function Test-RegistryValue ($regkey, $name, $value) {
     if ((Get-ItemProperty -Path $regkey -Name $name -ErrorAction Ignore).$name -eq $value) {
		 $true
     } else {
         $false
     }
 }

#Is Visual Studio Installed?


if (Test-Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\Setup'){

#check Update Settings
if (Test-RegistryValue 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio' 'AdministratorUpdatesEnabled' '2'){ Exit 0}else{ Exit 1}


}
else
{  Exit 0 }
#fix Code



#Is Visual Studio Installed?

if (Test-Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\Setup'){

New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup" -Name "AdministratorUpdatesEnabled" -Value 2 -PropertyType DWORD -Force 
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup" -Name "AdministratorUpdatesOptOut" -Value 0 -PropertyType DWORD -Force 
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AllowMUUpdateService" -Value 1 -PropertyType DWORD -Force 

}


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...