Unattended setup - how to add Microsoft Account and Pwd in answer file?


WinFan

New member
Local time
1:22 AM
Posts
9
OS
Windows 11
How can a Microsoft Account and password be added to an autounattend.xml file so that this can be automated?

There does not appear to be anything in the Unattended Windows Setup Reference that describes this, and no post that I can find after extensive searching, although there are numerous posts online about how to remove the prompt for a Microsoft Account.

Nobody is going to see these creds in the file - it's just being used for repeated setup of the same laptop for testing.

Thanks
 

My Computer

System One

  • OS
    Windows 11
Short answer is for technical reasons, Unattended answer files have never supported MS or AAD user accounts. Whenever you add, link, or manage those account types, a tiny web page appears which always connects to login.live.com.

Every device that uses a MS Account (PC, Xbox, Windows Phone) gets an unique user authentication token which is cached. From time to time, your token may expire or be revoked, and you will be asked to provide the password again. In this security model, having a Base64-encoded credential for a cloud-based account isn't secure.
 
Last edited:

My Computer

System One

  • OS
    Windows 7
@garlin : Thanks, I'm trying to automate getting to a freshly installed state for Windows 11 Pro, with the synced settings for Windows 11, Edge and OneDrive restored (no Store or other apps) for one user with a Microsoft Account as much as possible for a laptop that is rebuilt at least daily for specific testing.

FYI, some apps are removed and added post Windows setup using PowerShell scripts, so that parts is simple, but that's not really the scope here.

Can you suggest any approach to get to a freshly installed state for Windows 11 Pro with one user's Microsoft Account and the settings synced, other than doing an unattended setup with a local account, and thereafter, adding the user with the Microsoft Account interactively after setup has completed?

It would also be acceptable if the unattended setup stopped just once to enter the details for the Microsoft Account (which uses 2FA). Do you know how this would be possible? If this is the "tiny web page" to which you refer, that may prove acceptable.

Thanks
 

My Computer

System One

  • OS
    Windows 11
There's no way unless you do some complicated process which launches the Settings App and takes selective input focus and enters the password. If you've enabled 2FA, that's even worse...

If you're rebuilding your PC daily for testing, have you considered using a post-install VM instance with snapshots? As long as it's the same VM image, then the enabled account will still work.
 

My Computer

System One

  • OS
    Windows 7
Can you suggest any approach to get to a freshly installed state for Windows 11 Pro with one user's Microsoft Account and the settings synced
Make a system image of that state & restore it when you need to [instead of using an unattended setup].


All the best,
Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
There's no way unless you do some complicated process which launches the Settings App and takes selective input focus and enters the password. If you've enabled 2FA, that's even worse...

If you're rebuilding your PC daily for testing, have you considered using a post-install VM instance with snapshots? As long as it's the same VM image, then the enabled account will still work.
@garlin - Unfortunately, testing with a VM has run its course as installation of RAID drivers on real tin now has to be included in the build.
@Try3 - For the specific tests being done, a "manual install" was to be reproduced as closely as possible, but your system image suggestion is worth a try - it's not something that has been done in this case before.
Thanks Folks
 

My Computer

System One

  • OS
    Windows 11
For the specific tests being done, a "manual install" was to be reproduced as closely as possible, but your system image suggestion is worth a try - it's not something that has been done in this case before.
So do a manual install then make an image of that.
Every time you restore that image, the system will be in exactly the same state as it was after that manual install.


Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
Thanks, we'll test if that works with the RAID drivers and some others.
Another option that's been suggested is to run an unattended setup that creates a local user account, and inject the RAID drivers as suggested by @hsehestedt (a different thread)), and then log in manually with the Microsoft Account, and then take the image of that. The image can be used multiple times for very quick return to "testing state (with the MS Acc)" until something in the "base install" has to be changed, and then the unattended setup can be run again to build another image.

A hybrid of helpful suggestions - thank you!
 

My Computer

System One

  • OS
    Windows 11
Back
Top Bottom