# Nom du réseau autorisé $allowedSSID = "ProfsH3" # Obtenir la liste des profils Wi-Fi enregistrés $wifiProfiles = netsh wlan show profiles | Select-String "Profil Tous les utilisateurs" | ForEach-Object { ($_ -split ":")[1].Trim() } # Supprimer tous les profils sauf "ProfsH3" foreach ($profile in $wifiProfiles) { if ($profile -ne $allowedSSID) { Write-Output "Suppression du profil Wi-Fi : $profile" netsh wlan delete profile name="$profile" } } # Désactivation de la connexion automatique aux nouveaux réseaux netsh wlan set blockednetworks display=show netsh wlan add filter permission=denyall networktype=infrastructure # Autoriser uniquement le réseau "ProfsH3" netsh wlan add filter permission=allow ssid="$allowedSSID" networktype=infrastructure Write-Host "`n✅ Seul le réseau Wi-Fi '$allowedSSID' est désormais autorisé." -ForegroundColor Green