Overblog Tous les blogs Top blogs Technologie & Science Tous les blogs Technologie & Science
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU

Bloquer définitivement onedrive

Publié le par damcuvelier

Il me saoule, il n'arrête pas de revenir...

1. Mettre en place une règle firewall

Commande Powershell:
taskkill /IM OneDrive.exe /F 2>$null; Get-NetFirewallRule -DisplayName "Bloquer OneDrive*" -ErrorAction SilentlyContinue | Remove-NetFirewallRule; $paths=@("$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe","C:\Program Files\Microsoft OneDrive\OneDrive.exe","C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe"); $paths | Where-Object {Test-Path $_} | ForEach-Object {New-NetFirewallRule -DisplayName "Bloquer OneDrive sortant - $($_)" -Direction Outbound -Program $_ -Action Block -Profile Any -Enabled True}; $paths | Where-Object {Test-Path $_} | ForEach-Object {New-NetFirewallRule -DisplayName "Bloquer OneDrive entrant - $($_)" -Direction Inbound -Program $_ -Action Block -Profile Any -Enabled True}

2. Vérifier:

Get-NetFirewallRule -DisplayName "Bloquer OneDrive*" | Select-Object DisplayName,Enabled,Direction,Action
Résultat Attendu:
DisplayName                                                                 Enabled Direction Action
-----------                                                                 ------- --------- ------
Bloquer OneDrive sortant - C:\Program Files\Microsoft OneDrive\OneDrive.exe    True  Outbound  Block
Bloquer OneDrive entrant - C:\Program Files\Microsoft OneDrive\OneDrive.exe    True   Inbound  Block

 

3. Pour voir les chemins bloqués

Get-NetFirewallRule -DisplayName "Bloquer OneDrive*" | Get-NetFirewallApplicationFilter | Select-Object Program
Résultat Attendu:
Program
-------
C:\Program Files\Microsoft OneDrive\OneDrive.exe
C:\Program Files\Microsoft OneDrive\OneDrive.exe

 

Commenter cet article