diff --git a/scripts/disable-onedrive.reg b/scripts/disable-onedrive.reg deleted file mode 100644 index 1fff12a..0000000 Binary files a/scripts/disable-onedrive.reg and /dev/null differ diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index b6385d4..2ebd8a5 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -1,5 +1,5 @@ # Description: -# This script removes OneDrive files from your system. +# This script will remove and disable OneDrive integration. echo "Kill OneDrive process" kill "OneDrive.exe" @@ -16,4 +16,16 @@ echo "Removing OneDrive leftovers" rm -r -Force "$env:localappdata\Microsoft\OneDrive" rm -r -Force "$env:programdata\Microsoft OneDrive" rm -r -Force "$env:userprofile\OneDrive" -rm -r -Force "C:\OneDriveTemp" \ No newline at end of file +rm -r -Force "C:\OneDriveTemp" + +echo "Disable OneDrive via Group Policies" +$reg = @" +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive] +"DisableFileSyncNGSC"=dword:00000001 +"@ +$regfile = "$env:windir\Temp\registry.reg" +$reg | Out-File $regfile +regedit /s $regfile +rm $regfile \ No newline at end of file