Forum Discussion
Start OneDrive when windows starts - All domain computers
- Feb 19, 2020
try placing the key here instead:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
that should force it to run for all users on the device and you wont have to try and figure out how to inject into HKCU
try placing the key here instead:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
that should force it to run for all users on the device and you wont have to try and figure out how to inject into HKCU
dustintadam Thank you, that makes sense and will definitely work. Also, it just occurred to me, OneDrive can be installed for All Users by running OneDriveSetup.exe /allusers /silent.
Basically we could push that out to all computers as well, and the OneDrive client is then moved/installed to C:\Program Files (x86)\Microsoft OneDrive, which also makes updating run entries easier just to point at that location instead of the user folder.
Both seem like they'll work great. Thanks for your help!
- dustintadamFeb 19, 2020Iron Contributor
Yup, you can, in fact, if you want, here's the script we use when imaging computers (we use InTune and AutoPilot, but this will work with anything as it's just PowerShell)
It'll download whatever the current production release of the Sync client is and install it for all users:
$ODClient = "https://go.microsoft.com/fwlink/?linkid=844652"$output = "$ENV:temp" + '\OneDriveSetup.exe'$apppath = "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe"$action = New-ScheduledTaskAction -Execute $apppath$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date)Invoke-WebRequest -Uri $ODClient -OutFile $outputStart-Process -FilePath $output -ArgumentList '/allusers', '/silent'Start-Sleep -Seconds 60Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Launch OneDrive" | Out-NullStart-ScheduledTask -TaskName "Launch OneDrive"Start-Sleep -Seconds 5Unregister-ScheduledTask -TaskName "Launch OneDrive" -Confirm:$false}- rmoatFeb 19, 2020Brass Contributor
dustintadam Wow, that's great, and extremely helpful. Really appreciate this. Thank you, thank you! This will help with our deadline in a month to roll it out to everyone.
- dustintadamFeb 19, 2020Iron Contributorno problem, let me know if you need anything else.