Fix OneDrive Policy

Apply the "Prevent the usage of OneDrive for file storage" policy correctly. Previously, it created HKLM:Software\Policies\Microsoft\Windows\OneDrive\OneDrive="DisableFileSyncNGSC". However, the value should be HKLM:Software\Policies\Microsoft\Windows\OneDrive\DisableFileSyncNGSC=1
This commit is contained in:
Chuck Ricketts 2022-02-09 01:00:28 -06:00
parent a48b4d8dc5
commit cb32682aa3
2 changed files with 2 additions and 4 deletions

View File

@ -574,9 +574,8 @@ Function UninstallOneDrive {
$OneDriveKey = 'HKLM:Software\Policies\Microsoft\Windows\OneDrive'
If (!(Test-Path $OneDriveKey)) {
Mkdir $OneDriveKey
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
}
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
Set-ItemProperty $OneDriveKey -Name DisableFileSyncNGSC -Value 1
}
Write-Host "Uninstalling OneDrive. Please wait..."

View File

@ -1408,9 +1408,8 @@ $RemoveOnedrive.Add_Click( {
$OneDriveKey = 'HKLM:Software\Policies\Microsoft\Windows\OneDrive'
If (!(Test-Path $OneDriveKey)) {
Mkdir $OneDriveKey
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
}
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
Set-ItemProperty $OneDriveKey -Name DisableFileSyncNGSC -Value 1
}
Write-Host "Uninstalling OneDrive. Please wait..."