fix: remove OneDrive policy block to allow M365 reinstall
DisableFileSyncNGSC=1 prevented OneDrive from launching after M365 installation. Keep uninstall for clean PCs but drop the policy key so Office 365 can reinstall and run OneDrive without restrictions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7db5b4d1e8
commit
e78b6d23b8
2 changed files with 8 additions and 12 deletions
|
|
@ -241,13 +241,11 @@ catch {
|
||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# OneDrive - prevent setup and remove shortcuts
|
# OneDrive - uninstall from clean Windows (no policy block)
|
||||||
|
# NOTE: No policy key is set intentionally - M365 installation can reinstall
|
||||||
|
# and run OneDrive normally. Policy DisableFileSyncNGSC would prevent that.
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
Write-Log " Disabling OneDrive" -Level INFO
|
Write-Log " Uninstalling OneDrive" -Level INFO
|
||||||
|
|
||||||
# Disable OneDrive via policy
|
|
||||||
Set-Reg -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" `
|
|
||||||
-Name "DisableFileSyncNGSC" -Value 1
|
|
||||||
|
|
||||||
# Remove OneDriveSetup.exe if present
|
# Remove OneDriveSetup.exe if present
|
||||||
$oneDrivePaths = @(
|
$oneDrivePaths = @(
|
||||||
|
|
|
||||||
|
|
@ -241,13 +241,11 @@ catch {
|
||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# OneDrive - prevent setup and remove shortcuts
|
# OneDrive - uninstall from clean Windows (no policy block)
|
||||||
|
# NOTE: No policy key is set intentionally - M365 installation can reinstall
|
||||||
|
# and run OneDrive normally. Policy DisableFileSyncNGSC would prevent that.
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
Write-Log " Disabling OneDrive" -Level INFO
|
Write-Log " Uninstalling OneDrive" -Level INFO
|
||||||
|
|
||||||
# Disable OneDrive via policy
|
|
||||||
Set-Reg -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" `
|
|
||||||
-Name "DisableFileSyncNGSC" -Value 1
|
|
||||||
|
|
||||||
# Remove OneDriveSetup.exe if present
|
# Remove OneDriveSetup.exe if present
|
||||||
$oneDrivePaths = @(
|
$oneDrivePaths = @(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue