Suite à la mise en place d'n serveur WSUS j'aimerai automatiser la configuration des clients.
L'architecture est la suivante :
Un serveur maitre
-11 serveurs relai sur chaque sites qui deservent entre 50 et 400 clients chacuns.
Script
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v10_48x48_256.ico
#AutoIt3Wrapper_Outfile=..\wsus.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$WSUSServerURL = "adresse_du_serveur"
Global $WindowsUpdateKey = "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"
Global $TergetGroup = "nom_du_groupe"
$Reg_WUServer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUServer")
$Reg_WUStatusServer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUStatusServer")
$Reg_TargetGroup = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","TargetGroup")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUServer","REG_SZ","$WSUSServerURL")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUStatusServer","REG_SZ","$WSUSServerURL")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","TargetGroup","REG_SZ","$TergetGroup")
#AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v10_48x48_256.ico
#AutoIt3Wrapper_Outfile=..\wsus.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$WSUSServerURL = "adresse_du_serveur"
Global $WindowsUpdateKey = "HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate"
Global $TergetGroup = "nom_du_groupe"
$Reg_WUServer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUServer")
$Reg_WUStatusServer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUStatusServer")
$Reg_TargetGroup = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","TargetGroup")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUServer","REG_SZ","$WSUSServerURL")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","WUStatusServer","REG_SZ","$WSUSServerURL")
RegWrite("HKLM:\SOFTWARE\Policies\Microsoft\windows\WindowsUpdate","TargetGroup","REG_SZ","$TergetGroup")
Pour l'instant c'est une ébauche car mes connaissance en AutoIt sont limités, c'est mon premier script.
A terme j'aimerai que le scrip vérifie les clef
-Si elles sont bonne qu'il ne fasse aucune modif
-Sinon quil les modifies en attribuant les variables $TergetGroup et $WSUSServerURL
Afin de de répartir les clients dans les bons groupes il faudrait qu'il detecte l'os (soit win7 soit win10) et dans l'idéal une boucle pourrait detecter le réseau dans lequel le script est exécuté afin d'attribuer la bonne adresse à $WSUSServerURL.
En espérant que mon poste est bien claire je vous remercie par avance de prendre le temps de me répondre.
Bonne soirée