Open Victory61 opened 1 week ago
There is no built-in support for setting username and password dynamically.
I would try the following: Let Windows Setup enable the “Administrator” account and don't create any other accounts:
Then add a custom .ps1 script to run “when the first user logs on after Windows has been installed”, like so:
$username = Read-Host -Prompt 'Enter username';
$password = Read-Host -Prompt 'Enter password';
New-LocalUser -Name $username -Password( ConvertTo-SecureString -String $password -AsPlainText -Force ) -AccountNeverExpires -PasswordNeverExpires;
Get-LocalUser -Name Administrator | Disable-LocalUser
I have not tested this.
Thank you for the suggestion. In the 23H2 version I always used the script that I attach. In version 24H2 it doesn't work and I don't know how to modify it to make it compatible , this only allows the two requests for Username and Password. Thank you https://justpaste.it/du8ml
@Victory61 if you use ventoy, you can use $$VARNAME$$
. Ventoy will then ask you to type whatever you want into those variables.
That file has no <UserAccounts>
elements, hence Windows Setup will ask for the username. You can easily achieve this result when you select this setting:
However, while 23H2 let you create a local account, 24H2 practically forces you to create a Microsoft account.
@cschneegans Unfortunately, that selection offers me 3 requests and access to the Microsoft account
With the 23H2 script I only have 2 requests that I am interested in. In addition, the username option allows me to start the machine in audit mode (CTRL+SHIFT+F3)
@Victory61 se usi ventoy, puoi usare
$$VARNAME$$
. Ventoy ti chiederà quindi di digitare quello che vuoi in quelle variabili.
Gazie for the suggestion. I am not familiar with this procedure, I will try to figure out how to get the two requests.
@cschneegans
I entered the script but I get no request the installation proceeds as per the settings automatically until the end creating the user automatically.
I just re-examined the autounattend.xml
you posted earlier, which sets both the Let Windows Setup create the following local (“offline”) accounts and the Let Windows generate a random computer name like DESKTOP-ZFAH8Z2 options. Therefore, you should not see any of the dialogs from the screenshots you posted.
This is very similar to #63 – which .iso image did you use?
I downloaded the ISO from Media Creation Tool 24H2b26100.1742
I finally succeeded. I made a change to the generated script, inserting blocks from the old script, and I get the two requests and can also enter audit mode. https://justpaste.it/gucsx
With this procedure on a virtual machine I was able to enable Audit mode to update the wim file with the sysprep procedure. But I detected other problem, the captured vim file, even without any processing inside it and reinserted in the ISO, trying to install generates the same kind of error at the 75% rate. At this point I can't capier if it is the sys prep procedure that generates the vim file that causes problems. I didn't think I would find these difficulties with the 24H2 version downloaded from Media Creation Tool.
Good morning. Even inserting the file created by the generator I get the same error, I tried not inserting any autounattend file and the installation was successful, obviously with all the requirements. So I assume the incompatibility is created by the autounattend file after the procedure with sys prep.
Good morning I generated the response file and it is all OK, without any request during the installation. I wanted to ask how to modify the obtained xml file in such a way that during the installation I get only 2 requests: Username and Password. Thank you very much
`<?xml version="1.0" encoding="utf-8"?>