Windows 10 unattend instalation - Admin password

ronin
Beiträge: 10
Registriert: 03 Apr 2018, 13:57

Windows 10 unattend instalation - Admin password

Beitragvon ronin » 03 Apr 2018, 14:42

Hello ;),

I'm installed Win10 x64 with success, but with minors problems.
I cannot login after unattend instalation

I tried logins: Administrator and local-adm
with passwords: password123 and nt123

Please check my logs ;)

test.opsi.local.log
https://files.fm/u/zwh975ey

unattend.xml
https://files.fm/u/axnwk5vu

I want use only one local admin account - local-adm


Also durring unattend installation i had to choose OS to install:
Example photo
Bild

I have only one system to choose - Windows 10 pro, I thought this code from unattend.xml will take care of that:

Code: Alles auswählen

                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>1</Value>
                        </MetaData>
                    </InstallFrom>


Thank you ;)

d.haberland
Beiträge: 36
Registriert: 27 Sep 2017, 16:47

Re: Windows 10 unattend instalation - Admin password

Beitragvon d.haberland » 03 Apr 2018, 15:53

(Sry for my bad Englisch)

I made this so:

Code: Alles auswählen

            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows 10 Pro</Value>
                        </MetaData>
                    </InstallFrom>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>#@windows_partition_number*#</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                </OSImage>
            </ImageInstall>


I think you need this too (activate temporarily)

Code: Alles auswählen

            <UserData>
                <ProductKey>
                   <key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</key>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
            </UserData>


This key key is for the "temporary installation" i should work (on a german windowssystem) nut on a Englisch also.
In einer Ausbildung zum Fachinformatiker für Systemintegration :D

ronin
Beiträge: 10
Registriert: 03 Apr 2018, 13:57

Re: Windows 10 unattend instalation - Admin password

Beitragvon ronin » 03 Apr 2018, 16:03

d.haberland, thanks for replay

I'll try put OS name "Windows 10 Pro" on my next installation.

Can you help also with first log in ?
I cannot access to machine :/

d.haberland
Beiträge: 36
Registriert: 27 Sep 2017, 16:47

Re: Windows 10 unattend instalation - Admin password

Beitragvon d.haberland » 03 Apr 2018, 16:12

<Value>password</Value> = Here you can insert you wish password
Try this

Code: Alles auswählen

<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>password</Value>
                            <PlainText>false</PlainText>
                        </Password>
                        <Group>Administrators</Group>
                        <Name>Admin</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
</component>
In einer Ausbildung zum Fachinformatiker für Systemintegration :D

ronin
Beiträge: 10
Registriert: 03 Apr 2018, 13:57

Re: Windows 10 unattend instalation - Admin password

Beitragvon ronin » 03 Apr 2018, 21:30

d.haberland, thank you.
But, what about this lines:

Code: Alles auswählen

            <UserAccounts>
                <AdministratorPassword>
                    <PlainText>true</PlainText>
                    <Value>password123</Value>
                </AdministratorPassword>
            </UserAccounts>


Code: Alles auswählen

        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Description>Enable Admin Account</Description>
                    <Order>1</Order>
                    <Path>cmd.exe /c net user local-adm /active:yes</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Description>Passwd Admin Account</Description>
                    <Order>2</Order>
                    <Path>cmd.exe /c net user local-adm password123</Path>
                </RunSynchronousCommand>

            </RunSynchronous>
        </component>

Code: Alles auswählen

            <AutoLogon>
                <Enabled>true</Enabled>
                <LogonCount>1</LogonCount>
                <Username>local-adm</Username>
                <Password>
                    <PlainText>true</PlainText>
                    <Value>password123</Value>
                </Password>
            </AutoLogon>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Description>Opsi tasks</Description>
                    <Order>1</Order>
                    <CommandLine>cmd.exe /c C:\opsi\postinst.cmd</CommandLine>
                </SynchronousCommand>
            </FirstLogonCommands>


Are they necessary ?

Can you please share your unattend.xml file ?

Thank you ;)

d.haberland
Beiträge: 36
Registriert: 27 Sep 2017, 16:47

Re: Windows 10 unattend instalation - Admin password

Beitragvon d.haberland » 04 Apr 2018, 09:34

If you add my script you don't need this normaly

<UserAccounts>
<AdministratorPassword>
<PlainText>true</PlainText>
<Value>password123</Value>
</AdministratorPassword>
</UserAccounts>



<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Description>Enable Admin Account</Description>
<Order>1</Order>
<Path>cmd.exe /c net user local-adm /active:yes</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Description>Passwd Admin Account</Description>
<Order>2</Order>
<Path>cmd.exe /c net user local-adm password123</Path>
</RunSynchronousCommand>

</RunSynchronous>
</component>


here i have only this

<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Reseal>
<ForceShutdownNow>false</ForceShutdownNow>
</Reseal>
<DeviceForm>4</DeviceForm>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:c:/temp/windows10/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />


Autologon
Change the name and password, what you write in you Unattend

btw then you Change at both passwordfileds PlainText to "false" you password will encrypt

Code: Alles auswählen

<Password>
<PlainText>true</PlainText>
<Value>password123</Value>
</Password>
In einer Ausbildung zum Fachinformatiker für Systemintegration :D

ronin
Beiträge: 10
Registriert: 03 Apr 2018, 13:57

Re: Windows 10 unattend instalation - Admin password

Beitragvon ronin » 08 Apr 2018, 15:16

Hello,

Now i have problem at the end of OS installation.

Can you show your's unattend file ?

Thank you

Here is mine:

Code: Alles auswählen

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <!--
   ====================
   WINDOWSPE SETTINGS
   ====================
   The windowsPE configuration pass is used to configure settings specific to Windows PE as well as settings that apply to installation.
   For example, you can specify the display resolution of Windows PE, where to save a log file, and other Windows PE-related settings.
   -->
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk wcm:action="add">
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                    <CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>500</Size>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>2</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>System</Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>Windows</Label>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
</ModifyPartitions>
                </Disk>
            </DiskConfiguration>
            <UserData>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>1</Value>
                        </MetaData>
                    </InstallFrom>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>2</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                </OSImage>
            </ImageInstall>
        </component>
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>pl-PL</UILanguage>
                <WillShowUI>OnError</WillShowUI>
            </SetupUILanguage>
            <InputLocale>0415:00000415</InputLocale>
            <SystemLocale>pl-PL</SystemLocale>
            <UILanguage>pl-PL</UILanguage>
            <UILanguageFallback>pl-PL</UILanguageFallback>
            <UserLocale>pl-PL</UserLocale>
            <LayeredDriver>1</LayeredDriver>
        </component>
        <component name="Microsoft-Windows-PnPCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DriverPaths wcm:keyValue="1">
                <PathAndCredentials wcm:keyValue="1" wcm:action="add">
                    <Path wcm:keyValue="1">c:\drvpe</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>
    </settings>
    <!--
   =====================
   GENERALIZE SETTINGS
   =====================
   The generalize pass of Windows Setup is used to create a Windows reference image that can be used throughout an organization.
   A setting in the generalize pass enables you to automate the behavior for all deployments of this reference image.
   In comparison, a setting associated with the specialize configuration pass enables you to override behavior for a single, specific deployment.
   When a system is generalized, specific configuration data for a given installation of Windows is removed.
   For example, during the generalize pass, the unique security ID (SID) and other hardware-specific settings are removed from the image.
   The generalize configuration pass runs only when you use the sysprep /generalize command.
   Answer file settings in generalize are applied to the system before sysprep generalization occurs. The system then shuts down.
   -->
    <!--
   <settings pass="generalize">
   </settings>
   -->
    <!--
   =====================
   SPECIALIZE SETTINGS
   =====================
   During the specialize pass of Windows Setup, machine-specific information for the image is applied.
   For example, you can configure network settings, international settings, and domain information.
   The specialize pass is used in conjunction with the generalize pass.
   The generalize pass is used to create a Windows reference image that can be used throughout an organization.
   From this basic Windows reference image, you can add further customizations that apply to different divisions
   within an organization or apply to different installations of Windows.
   The specialize pass is used to apply these specific customizations.
   -->
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ComputerName>win10-pc</ComputerName>

        </component>

        <component name="Microsoft-Windows-RemoteAssistance-Exe" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <CreateEncryptedOnlyTickets>true</CreateEncryptedOnlyTickets>
            <fAllowToGetHelp>true</fAllowToGetHelp>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>0415:00000415</InputLocale>
            <SystemLocale>pl-PL</SystemLocale>
            <UILanguage>pl-PL</UILanguage>
            <UILanguageFallback>pl-PL</UILanguageFallback>
            <UserLocale>pl-PL</UserLocale>
        </component>

        <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DomainProfile_EnableFirewall>false</DomainProfile_EnableFirewall>
            <PrivateProfile_EnableFirewall>false</PrivateProfile_EnableFirewall>
            <PublicProfile_EnableFirewall>false</PublicProfile_EnableFirewall>
        </component>
        <component name="Security-Malware-Windows-Defender" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DisableAntiSpyware>true</DisableAntiSpyware>
        </component>
    </settings>
    <!--
   =========================
   OFFLINESERVICING SETTINGS
   =========================
   Use the offlineServicing pass to apply unattended Setup settings to an offline Windows image.
   During this configuration pass, you can add language packs, updates, or other packages to the offline image.
   The offlineServicing pass runs during Windows Setup. Setup extracts and installs the Windows image, and then executes Package Manager (Pkgmgr.exe).
   Packages listed in the servicing section of the answer file are applied to the offline Windows image.
   The Unattend.xml settings in the offlineServicing pass are applied to the offline Windows image.
   Additionally, you can use Package Manager with an answer file to install packages.
   -->
    <settings pass="offlineServicing">
        <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DriverPaths>
                <PathAndCredentials wcm:keyValue="1" wcm:action="add">
                    <Path>c:\drv</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>
    </settings>
    <!--
   =====================
   AUDITSYSTEM SETTINGS
   =====================
   The auditSystem pass is an optional pass that enables you to add additional device drivers and applications to the image.
   This results in fewer required images because a reference image can be created with a minimal set of drivers.
   The image can be updated with additional drivers during the audit process.
   You can then test and resolve any operating system issues related to malfunctioning or incorrectly installed devices on the image.
   For example, you can install additional language packs, updates, or other applications, such as Microsoft Office.
   See Reseal mode in oobeSystem.
   -->
    <!--
   <settings pass="auditSystem">
   </settings>
   -->
    <!--
   =====================
   AUDITUSER SETTINGS
   =====================
   The auditUser pass is similar to the auditSystem pass.
   However, the auditUser pass processes these settings after users have logged on, not before they have logged on.
   Like the auditSystem pass, the auditUser pass is used to test the functionality of the Windows Vista image.
   See Reseal mode in oobeSystem.
   -->
    <!--
   <settings pass="auditUser">
   </settings>
   -->
    <!--
   =====================
   OOBESYSTEM SETTINGS
   =====================
   The oobeSystem pass configures settings that are applied during the first-boot experience for end users, also called Windows Welcome.
   oobeSystem settings are processed before a user first logs into Windows.
   Out-of-Box-Experience (OOBE) runs the first time the user starts a new computer.
   OOBE runs before the Windows shell or any additional software runs, and performs a small set of tasks necessary to configure and run Windows.
   -->
    <settings pass="oobeSystem">

        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>password123</Value>
                            <PlainText>false</PlainText>
                        </Password>
                        <Group>Administrators</Group>
                        <Name>local-adm</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <TimeZone>Central European Standard Time</TimeZone>
            <AutoLogon>
                <Enabled>true</Enabled>
                <LogonCount>1</LogonCount>
                <Username>local-adm</Username>
                <Password>
                    <PlainText>false</PlainText>
                    <Value>password123</Value>
                </Password>
            </AutoLogon>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Description>Opsi tasks</Description>
                    <Order>1</Order>
                    <CommandLine>cmd.exe /c C:\opsi\postinst.cmd</CommandLine>
                </SynchronousCommand>
            </FirstLogonCommands>

            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <ProtectYourPC>3</ProtectYourPC>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
            </OOBE>

        </component>
   <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>0415:00000415</InputLocale>
            <SystemLocale>pl-PL</SystemLocale>
            <UILanguage>pl-PL</UILanguage>
            <UILanguageFallback>pl-PL</UILanguageFallback>
            <UserLocale>pl-PL</UserLocale>
        </component>

    </settings>
    <cpi:offlineImage cpi:source="wim:c:/temp/win10_/win10-x64/installfiles/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

uncle_scrooge
Beiträge: 431
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Windows 10 unattend instalation - Admin password

Beitragvon uncle_scrooge » 09 Apr 2018, 07:58

Now i have problem at the end of OS installation.

What kind of problem?

ronin
Beiträge: 10
Registriert: 03 Apr 2018, 13:57

Re: Windows 10 unattend instalation - Admin password

Beitragvon ronin » 10 Apr 2018, 20:22

I switched back to unattend.xml by opsi

I tried change name of default Administrator, but i can't find opion in netboot product properties "8.2.3 Some hints to the NT6 netboot products (Win7 to Win 10)"

Is it possible to have custom local admin name ? ;)

edit:
Also is it possible to add new NT6 product properties values ?

uncle_scrooge
Beiträge: 431
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Windows 10 unattend instalation - Admin password

Beitragvon uncle_scrooge » 11 Apr 2018, 22:38

I switched back to unattend.xml by opsi

Good boy.

I tried change name of default Administrator, but i can't find opion in netboot product properties

As there isn't any, finding one would be difficult.

Is it possible to have custom local admin name ?

Am not sure what you are really trying to achieve.
Renaming the built-in administrator account?
Or adding a second admin?
If it comes to renaming I would go with a postinstall script.
Place a file 95_renameadmin.cmd in /<YourNetbootProduct>/custom/postinst.d
Add the line

Code: Alles auswählen

wmic useraccount where name='administrator' rename teddybear

to the file. And on a fresh installed machine your administrator comes up as a cuddly toy.
For adding a second admin I would go with a postinstall script too. net user and net localgroup would be of help.
Or you can add a user/admin account from within the unattend.xml.
Find the OOBESYSTEM SETTINGS-section
Add something like this

Code: Alles auswählen

<UserAccounts>
                 <LocalAccounts>
                   <LocalAccount wcm:action="add">
                       <Password>
                           <Value>nt123</Value>
                           <PlainText>true</PlainText>
                       </Password>
                       <Description>MySecondAdmin</Description>
                       <DisplayName>Winnie the Pooh</DisplayName>
                       <Name>teddy</Name>
                       <Group>Administrators</Group>
                   </LocalAccount>
               </LocalAccounts>
           </UserAccounts>


A word to the wise: Don't try such an account for the autologon part. It might work, but chances are it will not. Stick with the built-in administrator.