I am trying to prepare a custom Windows 11 build for new devices in our organisation as we are not quite ready for Autopilot.
I am having some difficulty setting up OneDrive for the new devices. Previously, with our Windows 10 21H2 build we would install the software (ie. run OneDriveSetup.exe - double click to run as normal, as the temp user). We do have Office 365 installed using the ODT method but have OneDrive ecluded (as this ony sets up Personal). After running sysprep, and when the new user enrolls the device (AAD joined) we have found that the OneDrive is no longer installed. In addition, the Appx packages we removed before sysprep are now reinstalled (eg. Teams - we already have Teams work/school, but now have 2 after sysprep).
This was not an issue for Windows 10.
How do I install OneDrive on the device so that it is there for the new user when they login?
Note, each device is assigned to one user, who are local admins to that device. We are currently using WinPE, and have tried adding the command (remove appx and install OneDriveSetup.exe /silent) in the SetupComplete.cmd, but did not install.