Intention
I would like to use a Windows 10 virtual machine (VM) downloaded from Microsoft´s modern.ie website with Vagrant. Although Microsoft provides a download option which is prepared for Vagrant (s. picture 01) it actually can't be used out of the box and needs some further configuration (e.g. as described here). One thing which needs to be configured is user & password to boot with. The Machine defaults to boot with admin user IEUser
and password Passw0rd!
. I would like to know how to accomplish change of user/password in two different manners - manually (s. Question 1) and programmatically (s. Question 2)
Question 1
Which detailed steps I need to go through the Windows GUI to "really" change name & password of admin user IEUser
/ Passw0rd!
to e.g. vagrant
/ vagrant
?
NOTE: I already tried the obvious way
- User Accounts --> Change your account name --> vagrant
- User Account --> Make changes to my account in PC settings --> Sign-in option --> Password/Change --> Current password =>
Passw0rd!
--> New password =>vagrant
... etc. - I ended up booting with IEUser and wrong password
- I guess it is somehow related to the profile which I didn´t managed to change through the GUI (s. picture 02
Question 2
How to accomplish change of admin user and it´s password (IEUser
/ Passw0rd!
) from command line (cmd)? The aim of that is to have a script which can be called e.g. from Vagrantfile at vagrant up
-time.
I tried the following PowerShell commands which I found here but they did not work for me (maybe because they are meant for Windows Server 2012 R2(?)):
$admin=[adsi]"WinNT://./Administrator,user"
$admin.psbase.rename("vagrant")
$admin.SetPassword("vagrant")
$admin.UserFlags.value = $admin.UserFlags.value -bor 0x10000
$admin.CommitChanges()