Set-StrictMode -Version 2 # load required modules Import-Module ActiveDirectory Import-Module GroupPolicy #define variables $GPOName = 'GPO created by PowerShell' $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\Explorer\HideDesktopIcons\ClassicStartMenu' -Type DWord -ValueName '{031E4825-7B94-4dc3-B131-E946B44C8DD5}' -Value 1 | out-null Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel' -Type DWord -ValueName '{031E4825-7B94-4dc3-B131-E946B44C8DD5}' -Value 1 | out-null