Dans le cadre d’infrastructure d’entreprise, il est courant de mettre en place une solution de mise à jour indépendante du site Public Windows Update.
En effet, lorsque vous utilisez Windows Update public, vous utilisez la bande passante vers l’extérieur pour chaque serveur à mettre à jour, car vous devez télécharger chaque jeu de patches pour chaque machine. Il faut ajouter à cela le cas des machines qui ne doivent pas avoir accès au WEB.
Pour palier à cela, il existe une solution standard gratuite fournie par Microsoft :
Cet outil possède un très très grand nombre de fonctionnalités que l’on peut regrouper en deux catégories :
- L’application de patches sur les machines référencées dans l’application
- Le mode proxy pour les patches, utilisable par n’importe quelle machine
Dans notre cas, le script en question permet d’ajouter les clés de registre nécessaires pour exploiter la seconde fonctionnalité.
# Create the RegKeys used by the server to check the Update from your WSUS
# http://social.technet.microsoft.com/Forums/en-US/winserverwsus/thread/4935d71a-d3b5-45f5-94a9-69eeb31819d6$WSUSServerURL = “http://MyWSUSServer”
$WindowsUpdateKey = test-path "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"if($WindowsUpdateKey -eq $False)
{
Write-Host "Create the new Key WindowsUpdate"
$WindowsKey = New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"
}# Check Reg Key Before the change:
"WSUS Server URL value before: "+ (Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate").WUServer
"WSUS StatusServer URL value before: "+ (Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate").WUStatusServer# Create a key with the value:
Set-ItemProperty -path "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate" -name "WUServer" -Type String -value $WSUSServerURL
Set-ItemProperty -path "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate" -name "WUStatusServer" -Type String -value $WSUSServerURL# Check Reg Key after the change:
"WSUS Server URL value before: "+ (Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate").WUServer
"WSUS StatusServer URL value before: "+ (Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate").WUStatusServer# Reload the Windows Update CLient configuration
C:\WINDOWS\system32\wuauclt.exe /detectnow
Une fois que le script est exécuté, le client de mise à jour automatique du serveur fera son test sur le serveur WSUS défini dans le script.
Romelard Fabrice [MVP]
Commentaires
Enregistrer un commentaire