Feb 21 2021 01:14 AM - edited Feb 21 2021 11:21 PM
Hi
We follow below steps to install OneDrive Sync client to all end user machines using Configuration Manager
-> Copied the OneDrive.exe to a folder 21.022.0201.0001 under D:\OneDrive\ with CM server.
-> Created a new Application, Manually specified the application information, created a new deployment type, Manually specified the deployment information
Installation Program: OneDriveSetup.exe /AllUsers
Uninstall Program: %ProgramFiles(x86)%\Microsoft OneDrive\21.022.0201.0001\OneDriveSetup.exe /uninstall /allusers
Run installation and uninstall program as 32-bit process on 64-bit clients: Enabled
Add Clause (we will specify a Registry item for the Application Detection method) with below details
Setting Type: Registry
Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\OneDrive
Value: Version
This registry key is associated with a 32-bit application on 64-bit systems: Enabled
Data Type: Version
This registry setting must satisfy the following rule to indicate the presence of this application: Enabled
Operator: Greater than or equal to
Value: 21.022.0201.0001
or
Setting Type: Registry
Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Wow6432Node\Microsoft\OneDrive
Value: Version
This registry key is associated with a 32-bit application on 64-bit systems: Enabled
Data Type: Version
This registry setting must satisfy the following rule to indicate the presence of this application: Enabled
Operator: Greater than or equal to
Value: 21.022.0201.0001
Installation Behavior: Install for system
Logon Requirement: Whether or not a user is logged on
Installation program visibility: Hidden
**This allows the per-machine version to be detected independent of the underlying client architecture.
-> Created a new Task Sequence
Install Application, Name it, select the application,
Next we added a PowerShell script to our Task Sequence as mentioned earlier to remove the reference to the baked in OneDriveSetup.exe in “C:\Windows\SysWOW64\OneDriveSetup.exe”.
Enter the following script
Create PSDrive for HKU
New-PSDrive -PSProvider Registry -Name HKUDefaultHive -Root HKEY_USERS
Load Default User Hive
Reg Load "HKU\DefaultHive" "C:\Users\Default\NTUser.dat"
Set OneDriveSetup Variable
$OneDriveSetup = Get-ItemProperty "HKUDefaultHive:\DefaultHive\Software\Microsoft\Windows\CurrentVersion\Run" | Select -ExpandProperty "OneDriveSetup"
If Variable returns True, remove the OneDriveSetup Value
If ($OneDriveSetup) { Remove-ItemProperty -Path "HKUDefaultHive:\DefaultHive\Software\Microsoft\Windows\CurrentVersion\Run" -Name "OneDriveSetup" }
Unload Hive
Reg Unload "HKU\DefaultHive\"
Remove PSDrive HKUDefaultHive
Remove-PSDrive "HKUDefaultHive"
Change the PowerShell execution policy to Bypass
With most of the systems this works fine, some other systems it's not working (with Software center it's showing the status as waiting to Install). All the systems have some older versions of Onedrive sync client installed and it's having sync issues with on-premise Sharepoint 2019, the one provided by Microsoft fixes the issue and we want to install this version with all client PCs
We found that the installation not resuming with some PCs (with most of the systems configured Onedrive Sync client per user) and it succeeds after a restart or if we install it manually with /AllUsers switch. Don't know how to fix this issue and why the installation freeze at some point