Working on Windows 10 migration project and there is a need to enable automatic sign in of OneDrive for Business client when new user profile has been created. Windows 1709 image is golden installation image that will be used for global deployment. In the past months I have been working on different parts and with Windows 10 1709 the OneDrive client is now fully integrated into the profile.
The challenge I have is to do more automatic configuration. Speed up the profile creation process for smooth and less IT effort to deliver the computer to the end user.
Thanks to Adam Fowler from his post https://www.adamfowlerit.com/2018/02/onedrive-business-auto-sign-windows-10/ I was able to complete the remaining part on my end. The perquisites to have my script are working:
- ADFS infrastructure
- AD internal UPN same as in the cloud
- Office 365 licenses enabled
I have done my homework, ADFS is in place, UPN is fixed, license for O365 enabled so now I only need a script sequence to run some commands to automatically do that. One important settings is from Computer Configuration GPO policy to enable "Silently configure OneDrive using the primary Windows account". This was for me in place before but was missing the part below to really run the setup and make sure modern authentication was enabled for OneDrive within the user profile (HKEY_CURRENT_USER)
Create new CMD file below and make sure it added to RunOnce
- I am using SCCM task sequence to add this to the default profile registers and place the CMD locally on the computer
- This file can also be executed manually or through logon script
%localappdata%\Microsoft\OneDrive\Update\OneDriveSetup.exe taskkill /f /im OneDrive.exe reg add HKCU\Software\Microsoft\OneDrive /v EnableADAL /t REG_DWORD /d 1 /f "%localappdata%\Microsoft\OneDrive\OneDrive.exe"
Final end result :). OneDrive is configured and synced.