Set-StrictMode -Version 2 # load required modules Import-Module ActiveDirectory Import-Module GroupPolicy #define variables $GPOName = 'GPO-FR-IE-Proxy-Parameters' $defaultNC = ( [ADSI]"LDAP://RootDSE" ).defaultNamingContext.Value #$TargetOU = 'OU=Serveurs,' + $defaultNC $TargetOU = $defaultNC #create new GPO shell $GPO = New-GPO -Name $GPOName #Pose d'éléments pour modifier des clés de registre par GPO Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Type DWord -ValueName 'MigrateProxy' -Value 1 | out-null Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Type DWord -ValueName 'ProxyEnable' -Value 1 | out-null Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Type DWord -ValueName 'ProxyHttp1.1' -Value 1 | out-null Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Type String -ValueName 'ProxyServer' -Value '192.1.1.1:9999' | out-null Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Type String -ValueName 'ProxyOverride' -Value '' | out-null