Is there a way to add (not register but add like local user account) ONLINE accounts on Win10 and specify their home directory? set it as admin?

I have found plenty of how-to regarding creating local admins but unfortunately none regarding ONLINE accounts. All I want to is to have same path for home directories across all my PCs.

Is there is equivalent for:

user username password /add

but for online accounts?

In theory:

PS> New-LocalUser -Name "MicrosoftAccount\SomeAccou[email protected]" -Description "Microsoft Account"

According to https://blog.netwrix.com/2018/09/18/how-to-add-delete-and-change-local-users-and-groups-with-powershell/


However, there is still a bug that returns this message when running the command: “New-LocalUser: Cannot validate argument on parameter ‘Name’. The character length of the 36 argument is too long. Shorten the character length of the argument so it is fewer than or equal to “20” characters, and then try the command again.” As a result, the easiest way to get around this problem is to create a local account and then use the Settings app to link it with a Microsoft account.


2 Answers 2


You cannot create an online account locally, because it is an online account.

You can create the same useraccount locally on all pc's and then the path will be the same everywhere, or create the online account once, and then login with it on every computer. Either will work, you just cannot create the online account by script. You have to actually register it first.

Once you have a microsoft account and you login with it, it can be given admin rights by adding it to the Administrator's user group or setting it as admin from Settings.


Is there a way to add (not register but add like local user account) ONLINE accounts on Win10 and specify their home directory? set it as admin?

The only way you can do this with individual is to create a Microsoft Account or Accounts for each computer.

Then you can sync settings and documents as you wish.

The home directory will be unique to each computer (even if the accounts appear to have the same name)

All I want to is to have same path for home directories across all my PCs.

I am not sure precisely what you mean. Because the home user is unique for each computer (cannot be the same for other computers), the home path will be similar but will be different. (I have two machines with the same 5 character USER name) but the actual machine names are different).

Also over time, different users (or the same user) will add a folder to one machine that is not on another machine. You just need to review occasionally. Microsoft Accounts can sync settings but you would need to use a syncing App to sync documents.

Finally it does not matter whether accounts are admin or standard. That is not related to having a Microsoft Account (or local account).

  • 1
    Im a family man - I have beside me 3 other family members. With each PC I need to login with my MS Account and add remaining family members (each one has his own MS Account). Can I automate it? Can I run some "user add" command to add other family members with their MS Accounts? Or maybe I could create admin account and remotely add whole family to such PC? The reason why its important to me to have all HOME dirs exacly same named is that the next step for me is to sync their HOME folders with remote drive as a backup solution.
    – Lemonek
    Feb 1, 2022 at 13:57
  • Setting up Accounts is a one - time thing. Just set them up. Nothing gained by automating 3 setups. The Home Directory will be the 5 char rendition of the the USER of the machine. The paths will look the same at first. But the accounts are different. And over time people will add document folders that are not on the other machines.
    – John
    Feb 1, 2022 at 14:00
  • 3 of family members are using email addresses starting with Surname which is common for all family members, so 2nd and 3rd account will have some addition to its name beside 5 chars of emails. So in short - I cannot automate adding MS Accounts to PC and there is possibility to determinate for HOME path for those other than actually login to such account and checking - right?
    – Lemonek
    Feb 1, 2022 at 14:12
  • The computers will be different in some way. This is ALWAYS true. You would need to log on to each computer and verify home paths. Even "home" directories on a Server can change contents over time.
    – John
    Feb 1, 2022 at 14:15
  • That is why in next step I have planned to automate syncing between local and private cloud drive, but for that I need to have some fixed paths for easy deployments :)
    – Lemonek
    Feb 1, 2022 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .