Posté(e) il y a 5 heures5 h Miaou,J'ai fait un script que je lance lors d'installation de nouveau poste dans un environnement d'entreprise. D'abord, je lance mon .bat (en admin) qui va faire un bypass et qui va lancer le script en powershell.Attention : les deux fichiers doivent être dans le même dossier.Run-Win11-Clean.bat@echo off title MATRIX - Win11 Enterprise Clean color 0A mode con: cols=95 lines=30 cd /d "%~dp0" echo. echo ############################################################# echo # WIN11 ENTERPRISE CLEAN - MATRIX LAUNCHER # echo ############################################################# echo. powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win11-Enterprise-Clean.ps1" echo. echo Termine. Appuie sur une touche pour fermer. pause >nulEt le script power shell Win11-Enterprise-Clean#requires -RunAsAdministrator <# Win11 Enterprise Clean - Matrix Mode - Ne supprime PAS OneDrive - Ne touche PAS Copilot - Réduit télémétrie / suggestions / CEIP - Restaure le clic droit classique Windows 10 #> $Host.UI.RawUI.BackgroundColor = "Black" $Host.UI.RawUI.ForegroundColor = "Green" Clear-Host function Matrix-Line { param([string]$Text) Write-Host "[MATRIX] $Text" -ForegroundColor Green Start-Sleep -Milliseconds 250 } function Step { param([string]$Text) Write-Host "" Write-Host "[>>] $Text" -ForegroundColor Green Start-Sleep -Milliseconds 300 } function Ok { param([string]$Text) Write-Host "[OK] $Text" -ForegroundColor DarkGreen } function Warn { param([string]$Text) Write-Host "[!!] $Text" -ForegroundColor Yellow } function Fail { param([string]$Text) Write-Host "[ERREUR] $Text" -ForegroundColor Red } function Progress-Matrix { param( [string]$Activity, [int]$Seconds = 1 ) for ($i = 1; $i -le 100; $i += 10) { Write-Progress -Activity $Activity -Status "$i% complete" -PercentComplete $i Start-Sleep -Milliseconds ($Seconds * 80) } Write-Progress -Activity $Activity -Completed } Write-Host "" Write-Host "============================================================" -ForegroundColor Green Write-Host " WIN11 ENTERPRISE CLEAN - MATRIX MODE" -ForegroundColor Green Write-Host "============================================================" -ForegroundColor Green Write-Host "" Matrix-Line "Wake up, admin..." Matrix-Line "The system has you..." Matrix-Line "Applying enterprise-safe privacy tweaks..." Write-Host "" # --- Deblocage temporaire --- Step "Deblocage temporaire PowerShell pour cette session" try { Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force Ok "ExecutionPolicy temporaire definie sur Bypass" } catch { Warn "Impossible de modifier ExecutionPolicy. Une GPO domaine peut bloquer cette action." } try { Unblock-File -Path $PSCommandPath -ErrorAction SilentlyContinue Ok "Fichier script debloque avec Unblock-File" } catch { Warn "Unblock-File impossible ou non necessaire" } Progress-Matrix "Initialisation" 1 # --- Diagnostic data --- Step "Configuration de la telemetrie au minimum" try { New-Item "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Force | Out-Null Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" ` -Name "AllowTelemetry" -Type DWord -Value 1 Ok "Telemetrie configuree sur Required / Basic" } catch { Fail "Erreur pendant la configuration de la telemetrie" } Progress-Matrix "Telemetrie" 1 # --- Experiences personnalisees --- Step "Desactivation des experiences personnalisees" try { New-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy" -Force | Out-Null Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy" ` -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0 Ok "Experiences personnalisees desactivees" } catch { Fail "Erreur pendant la desactivation des experiences personnalisees" } # --- Advertising ID --- Step "Desactivation de l'Advertising ID" try { New-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Force | Out-Null Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" ` -Name "Enabled" -Type DWord -Value 0 Ok "Advertising ID desactive" } catch { Fail "Erreur pendant la desactivation de l'Advertising ID" } Progress-Matrix "Confidentialite utilisateur" 1 # --- Suggestions Windows --- Step "Desactivation des suggestions Windows et contenus sponsorises" try { $cdm = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" New-Item $cdm -Force | Out-Null $cdmValues = @{ "ContentDeliveryAllowed" = 0 "OemPreInstalledAppsEnabled" = 0 "PreInstalledAppsEnabled" = 0 "PreInstalledAppsEverEnabled" = 0 "SilentInstalledAppsEnabled" = 0 "SoftLandingEnabled" = 0 "SystemPaneSuggestionsEnabled" = 0 "SubscribedContent-310093Enabled" = 0 "SubscribedContent-338388Enabled" = 0 "SubscribedContent-338389Enabled" = 0 "SubscribedContent-338393Enabled" = 0 "SubscribedContent-353694Enabled" = 0 "SubscribedContent-353696Enabled" = 0 "SubscribedContent-353698Enabled" = 0 } foreach ($name in $cdmValues.Keys) { Set-ItemProperty $cdm -Name $name -Type DWord -Value $cdmValues[$name] } Ok "Suggestions, apps promues et contenus sponsorises desactives" } catch { Fail "Erreur pendant la desactivation des suggestions Windows" } Progress-Matrix "Suggestions Windows" 1 # --- Consumer Features --- Step "Desactivation des Windows Consumer Features" try { New-Item "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" ` -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 Ok "Windows Consumer Features desactivees" } catch { Fail "Erreur pendant la configuration des Consumer Features" } # --- Feedback prompts --- Step "Desactivation des demandes de feedback" try { New-Item "HKCU:\Software\Microsoft\Siuf\Rules" -Force | Out-Null Set-ItemProperty "HKCU:\Software\Microsoft\Siuf\Rules" ` -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 Set-ItemProperty "HKCU:\Software\Microsoft\Siuf\Rules" ` -Name "PeriodInNanoSeconds" -Type DWord -Value 0 Ok "Demandes de feedback desactivees" } catch { Fail "Erreur pendant la desactivation des feedback prompts" } Progress-Matrix "Feedback" 1 # --- CEIP scheduled tasks --- Step "Desactivation des taches CEIP compatibles entreprise" $tasks = @( "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser", "\Microsoft\Windows\Application Experience\ProgramDataUpdater", "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator", "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" ) foreach ($task in $tasks) { try { schtasks /Change /TN $task /Disable 2>$null | Out-Null Ok "Tache desactivee : $task" } catch { Warn "Impossible de desactiver : $task" } } Progress-Matrix "Taches CEIP" 1 # --- Menu clic droit classique --- Step "Restauration du menu clic droit classique Windows 10" try { $classicMenuPath = "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" New-Item $classicMenuPath -Force | Out-Null Set-ItemProperty $classicMenuPath -Name "(default)" -Value "" Ok "Menu contextuel classique active" } catch { Fail "Erreur pendant l'activation du menu contextuel classique" } Progress-Matrix "Menu contextuel" 1 # --- Redemarrage Explorer --- Step "Redemarrage d'Explorer" try { Stop-Process -Name explorer -Force Ok "Explorer redemarre" } catch { Warn "Impossible de redemarrer Explorer automatiquement" } Write-Host "" Write-Host "============================================================" -ForegroundColor Green Write-Host " OPERATION TERMINEE" -ForegroundColor Green Write-Host "============================================================" -ForegroundColor Green Write-Host "" Ok "OneDrive non modifie" Ok "Copilot non modifie" Ok "Compatible environnement de travail / M365" Warn "Redemarrage du PC conseille pour appliquer tous les changements" Write-Host "" Write-Host "Follow the white rabbit..." -ForegroundColor DarkGreen Write-Host ""Win11-Enterprise-Clean.ps1 Run-Win11-Clean.bat Modifié il y a 5 heures5 h par MeowMeow
Posté(e) il y a 4 heures4 h Un grand merci pour ces scripts pour nettoyer un peu Windows après une installation fraîche Petite question : On conserve toute les fonctionnalités windows store + game bar ?
Rejoindre la conversation
Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.