无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 4358|回复: 17
打印 上一主题 下一主题

试了好久,Autounattend.xml无人值守文件的自动登录不生效

[复制链接]
跳转到指定楼层
1#
发表于 2023-4-14 17:15:30 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
这是我在用的Autounattend.xml,其它加了很多注释
其中有一段是关于AutoLogon,但不管我怎么配置,用这个xml部署的win10,最后都不需要帐号密码就可以进入系统。现在我要的是安装系统后,需要用户输入密码才可以进入。要怎么改呢?


<!--
具体可参考微软的文档
https://learn.microsoft.com/en-u ... -8.1-and-8/ff716114(v=win.10)
-->
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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>
                <Disk wcm:action="add">
                    <!-- 第0个磁盘-->
                    <DiskID>0</DiskID>
                    <CreatePartitions>
                    <!--
                    创建磁盘分区
                    Order元素指定了分区的顺序
                    Type元素指定了分区的类型(主分区或逻辑分区)
                    Size元素指定了分区的大小(以MB为单位)
                    Extend为true,则创建的分区会将后面的未分配空间合并到该分区中。
                    未指定或指定为false,则创建的分区不会合并未分配空间,未分配的空间将保持为未分配状态,可以在之后的操作中进行分配。
                    -->
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>100</Size>
                            <Type>EFI</Type>
                            <Extend>false</Extend>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Size>16</Size>
                            <Type>MSR</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>3</Order>
                            <Size>102400</Size>
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>4</Order>
                            <Type>Primary</Type>
                            <!--未分配空间合并到该分区中-->
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <!--
                    修改磁盘分区信息
                    Format指定了分区的格式
                    Label指定驱动器名称
                    Letter指定盘符
                    -->
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Format>FAT32</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>3</Order>
                            <PartitionID>3</PartitionID>
                            <Label>Win</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>4</Order>
                            <PartitionID>4</PartitionID>
                            <Label>Tools</Label>
                            <Letter>D</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <!--安装期间出现错误时显示 UI,以便用户能够了解错误的原因-->
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <UserData>
                <!--
                WillShowUI:Never 不会显示产品密钥 UI,而是使用预先指定的产品密钥进行自动化安装。如果需要更改产品密钥,则可以在安装完成后手动添加它。
                AcceptEula:true 指定自动接受 Windows 使用条款的选项,从而避免在安装期间出现任何与使用条款相关的 UI。这也是一种自动化安装过程的方式,以确保一致性和简化安装过程。
                -->
                <ProductKey>
                    <WillShowUI>Never</WillShowUI>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <!-- 操作系统的版本-->
                            <Key>/image/name</Key>
                            <Value>Windows 10 Pro</Value>
                        </MetaData>
                    </InstallFrom>
                    <WillShowUI>OnError</WillShowUI>
                    <!--
                    InstallToAvailablePartitionInstallToAvailablePartition
                    true:指定将Windows安装到具有足够空间的第一个可用分区,Windows安装程序从第一个磁盘上的磁盘0和分区1开始搜索可用分区,并继续搜索所有可用磁盘。
                    false:不会自动安装 Windows 到可用分区。程序会使用Microsoft-Windows-Setup->ImageInstall->OSImage->InstallTo所指定的分区
                    -->
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
                    <InstallTo>
                        <!-- 安装在第1个盘的第3个区-->
                        <DiskID>0</DiskID>
                        <PartitionID>3</PartitionID>
                    </InstallTo>
                </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>
                <!--安装语言为 "en-US"-->
                <UILanguage>en-US</UILanguage>
                <!--安装期间不显示 UI-->
                <WillShowUI>Never</WillShowUI>
            </SetupUILanguage>
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <!--指定PC/AT增强型键盘(101/102键)-->
            <LayeredDriver>1</LayeredDriver>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Security-SPP-UX" 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">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <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">
            <RunAsynchronous>
                <!--Windows 安装期间异步执行命令-->
                <RunAsynchronousCommand wcm:action="add">
                    <!--描述-->
                    <Description>disable admin</Description>
                    <!--表示该命令将在第1个异步命令之后执行-->
                    <Order>1</Order>
                    <!--要执行的命令
                    cmd /c net user administrator /active:yes
                    这个命令的作用是关闭管理员帐户-->
                    <Path>cmd /c net user administrator /active:no </Path>
                </RunAsynchronousCommand>

            </RunAsynchronous>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <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">
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <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">

        <!--
            p@ssword"
            设置指定是否启用自动登录过程
            <AutoLogon>
                <Password>
                    <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                    <PlainText>false</PlainText>
                </Password>
                <Enabled>false</Enabled>
                <LogonCount>1</LogonCount>
                <Username>AOD</Username>
            </AutoLogon>
            -->
            <OOBE>
                <!--隐藏用户许可协议页面-->
                <HideEULAPage>true</HideEULAPage>
                <!--隐藏本地帐户设置页面-->
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <!--隐藏OEM注册页面-->
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <!--隐藏在线帐户设置页面-->
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <!--隐藏无线网络设置页面-->
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <!--指定网络位置类型。可选值有Home、Work、Other。Other禁用网络发现-->
                <NetworkLocation>Other</NetworkLocation>
                <!--指定“PC安全保护”设置的级别。在此示例中,设置为“3”,即自动开启Windows防火墙并下载和安装重要更新-->
                <ProtectYourPC>3</ProtectYourPC>
                <!--不启用零售演示模式-->
                <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
                <!--跳过计算机OOBE(包括网络设置,Windows更新和其他设置)-->
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <!--跳过用户OOBE(包括设置个人首选项和设置)-->
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <!--设置管理员密码-->
            <UserAccounts>
                <!-- 设置administrator密码
                <AdministratorPassword>
                    <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                    <PlainText>false</PlainText>
                </AdministratorPassword>
                -->
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                     <Password>
                        <!--p@ssword"-->
                        <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                        <PlainText>false</PlainText>
                     </Password>
                     <Description>.</Description>
                     <DisplayName>AOD</DisplayName>
                     <Group>Administrators</Group>
                     <Name>AOD</Name>
                    </LocalAccount>
                  </LocalAccounts>

            </UserAccounts>
            <!--显示蓝牙任务栏图标-->
            <BluetoothTaskbarIconEnabled>true</BluetoothTaskbarIconEnabled>
            <!--禁用自动设置夏令时选项-->
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
            <!--禁止在任务栏中清除通知和操作中心-->
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
            <!--不显示Windows Live服务链接-->
            <ShowWindowsLive>false</ShowWindowsLive>
            <!--设置注册组织名称,即在计算机属性中查看的组织名称-->
            <RegisteredOrganization>AOD</RegisteredOrganization>
            <!--设置计算机的注册所有者名称-->
            <RegisteredOwner>AOD</RegisteredOwner>
            <!--设置时区,这里设置为中国标准时间-->
            <TimeZone>China Standard Time</TimeZone>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>






2#
发表于 2023-4-14 17:34:01 | 只看该作者
应该是存在这个文件:
Windows\Panther\unattend.xml
删掉试试
回复

使用道具 举报

3#
发表于 2023-4-14 17:37:04 | 只看该作者
封装用的无人值守好像应该在这个文件中定义:
回复

使用道具 举报

4#
 楼主| 发表于 2023-4-14 17:47:56 | 只看该作者
Autounattend.xml和unattend.xml都是Windows操作系统安装程序中使用的答案文件,它们都可以自动化和定制化Windows安装过程。但是它们之间有一些区别:

    Autounattend.xml是Windows Vista及更高版本的安装程序所使用的答案文件,而unattend.xml是Windows XP及更早版本的安装程序所使用的答案文件。

    Autounattend.xml支持更多的自动化安装选项和设置,包括更复杂的磁盘分区和卷标、安装驱动程序、安装Windows更新、加入域、安装IIS等等。而unattend.xml的选项相对较少。

    Autounattend.xml文件必须被命名为Autounattend.xml,而unattend.xml可以使用其他名称,但必须被放置在Windows安装媒体根目录下的$OEM$文件夹内。

综上所述,如果你在使用Windows Vista及更高版本的操作系统,应该使用Autounattend.xml文件进行自动化安装和配置,而如果你在使用Windows XP及更早版本的操作系统,则应该使用unattend.xml文件。
回复

使用道具 举报

5#
发表于 2023-4-14 18:01:00 | 只看该作者
我的意思,是不是同时存在unattend.xml导致的?
回复

使用道具 举报

6#
发表于 2023-4-14 18:44:05 | 只看该作者
删除区段:<UserAccounts></UserAccounts> 试试

点评

不对,因为我需要关了administrator,并在UserAccounts添加一个新的用户进到administrators组  详情 回复 发表于 2023-4-14 21:41
回复

使用道具 举报

7#
发表于 2023-4-14 20:34:44 | 只看该作者
你好,请教一下,以上文件从哪保存起可以实现无人值守安装?
回复

使用道具 举报

8#
发表于 2023-4-14 20:36:43 | 只看该作者
谢谢分享
回复

使用道具 举报

9#
 楼主| 发表于 2023-4-14 21:41:33 | 只看该作者

不对,因为我需要关了administrator,并在UserAccounts添加一个新的用户进到administrators组
回复

使用道具 举报

10#
 楼主| 发表于 2023-4-14 21:52:58 | 只看该作者
<!--
具体可参考微软的文档
https://learn.microsoft.com/en-u ... -8.1-and-8/ff716114(v=win.10)
-->
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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>
                <Disk wcm:action="add">
                    <!-- 第0个磁盘-->
                    <DiskID>0</DiskID>
                    <CreatePartitions>
                    <!--
                    创建磁盘分区
                    Order元素指定了分区的顺序
                    Type元素指定了分区的类型(主分区或逻辑分区)
                    Size元素指定了分区的大小(以MB为单位)
                    Extend为true,则创建的分区会将后面的未分配空间合并到该分区中。
                    未指定或指定为false,则创建的分区不会合并未分配空间,未分配的空间将保持为未分配状态,可以在之后的操作中进行分配。
                    -->
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>100</Size>
                            <Type>EFI</Type>
                            <Extend>false</Extend>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Size>16</Size>
                            <Type>MSR</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>3</Order>
                            <Size>102400</Size>
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>4</Order>
                            <Type>Primary</Type>
                            <!--未分配空间合并到该分区中-->
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <!--
                    修改磁盘分区信息
                    Format指定了分区的格式
                    Label指定驱动器名称
                    Letter指定盘符
                    -->
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Format>FAT32</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>3</Order>
                            <PartitionID>3</PartitionID>
                            <Label>Win</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>4</Order>
                            <PartitionID>4</PartitionID>
                            <Label>Tools</Label>
                            <Letter>D</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <!--安装期间出现错误时显示 UI,以便用户能够了解错误的原因-->
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <UserData>
                <!--
                WillShowUI:Never 不会显示产品密钥 UI,而是使用预先指定的产品密钥进行自动化安装。如果需要更改产品密钥,则可以在安装完成后手动添加它。
                AcceptEula:true 指定自动接受 Windows 使用条款的选项,从而避免在安装期间出现任何与使用条款相关的 UI。这也是一种自动化安装过程的方式,以确保一致性和简化安装过程。
                -->
                <ProductKey>
                    <WillShowUI>Never</WillShowUI>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <!-- 操作系统的版本-->
                            <Key>/image/name</Key>
                            <Value>Windows 10 Pro</Value>
                        </MetaData>
                    </InstallFrom>
                    <WillShowUI>OnError</WillShowUI>
                    <!--
                    InstallToAvailablePartitionInstallToAvailablePartition
                    true:指定将Windows安装到具有足够空间的第一个可用分区,Windows安装程序从第一个磁盘上的磁盘0和分区1开始搜索可用分区,并继续搜索所有可用磁盘。
                    false:不会自动安装 Windows 到可用分区。程序会使用Microsoft-Windows-Setup->ImageInstall->OSImage->InstallTo所指定的分区
                    -->
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
                    <InstallTo>
                        <!-- 安装在第1个盘的第3个区-->
                        <DiskID>0</DiskID>
                        <PartitionID>3</PartitionID>
                    </InstallTo>
                </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>
                <!--安装语言为 "en-US"-->
                <UILanguage>en-US</UILanguage>
                <!--安装期间不显示 UI-->
                <WillShowUI>Never</WillShowUI>
            </SetupUILanguage>
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <!--指定PC/AT增强型键盘(101/102键)-->
            <LayeredDriver>1</LayeredDriver>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Security-SPP-UX" 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">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <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">
            <RunAsynchronous>
                <!--Windows 安装期间异步执行命令-->
                <RunAsynchronousCommand wcm:action="add">
                    <!--描述-->
                    <Description>disable admin</Description>
                    <!--表示该命令将在第1个异步命令之后执行-->
                    <Order>1</Order>
                    <!--
                    要执行的命令,下面命令的作用是关闭administrator帐户,active:yes是开启
                    -->
                    <Path>cmd /c net user administrator /active:no </Path>
                </RunAsynchronousCommand>

            </RunAsynchronous>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <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">
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <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">

        <!--
            p@ssword"
            设置指定是否启用自动登录过程

            <AutoLogon>
                <Password>
                    <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                    <PlainText>false</PlainText>
                </Password>
                <Enabled>false</Enabled>
                <LogonCount>1</LogonCount>
                <Username>AOD</Username>
            </AutoLogon>
            -->
            <OOBE>
                <!--隐藏用户许可协议页面-->
                <HideEULAPage>true</HideEULAPage>
                <!--隐藏本地帐户设置页面-->
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <!--隐藏OEM注册页面-->
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <!--隐藏在线帐户设置页面-->
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <!--隐藏无线网络设置页面-->
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <!--指定网络位置类型。可选值有Home、Work、Other。Other禁用网络发现-->
                <NetworkLocation>Other</NetworkLocation>
                <!--指定“PC安全保护”设置的级别。在此示例中,设置为“3”,即自动开启Windows防火墙并下载和安装重要更新-->
                <ProtectYourPC>3</ProtectYourPC>
                <!--不启用零售演示模式-->
                <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
                <!--跳过计算机OOBE(包括网络设置,Windows更新和其他设置)-->
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <!--跳过用户OOBE(包括设置个人首选项和设置)-->
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <UserAccounts>
                <!-- 设置administrator密码,因为关闭了administrator,所以这里密码也不用设置了
                <AdministratorPassword>
                    <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                    <PlainText>false</PlainText>
                </AdministratorPassword>
                -->

                <!--本地用户-->
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                     <Password>
                        <!--p@ssword"-->
                        <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>
                        <PlainText>false</PlainText>
                     </Password>
                     <Description></Description>
                     <DisplayName>AOD</DisplayName>
                     <Group>Administrators</Group>
                     <Name>AOD</Name>
                    </LocalAccount>
                  </LocalAccounts>
            </UserAccounts>
            <!--显示蓝牙任务栏图标-->
            <BluetoothTaskbarIconEnabled>true</BluetoothTaskbarIconEnabled>
            <!--禁用自动设置夏令时选项-->
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
            <!--禁止在任务栏中清除通知和操作中心-->
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
            <!--不显示Windows Live服务链接-->
            <ShowWindowsLive>false</ShowWindowsLive>
            <!--设置注册组织名称,即在计算机属性中查看的组织名称-->
            <RegisteredOrganization>AOD</RegisteredOrganization>
            <!--设置计算机的注册所有者名称-->
            <RegisteredOwner>AOD</RegisteredOwner>
            <!--设置时区,这里设置为中国标准时间-->
            <TimeZone>China Standard Time</TimeZone>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>





不行,我用这个autounattend.xml,可以无人会上值守的安装win10,并关闭了administrator,并建了一个aod的用户,但每次进系统都不需要输密码,我想要输密码啊,要怎么改


回复

使用道具 举报

11#
发表于 2023-4-14 22:07:45 | 只看该作者
用ntlie生成
回复

使用道具 举报

12#
发表于 2023-4-15 02:29:40 | 只看该作者
在FirstLogonCommands里执行:

  1. reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 0 /f
复制代码


微软给的解决办法

点评

收到,感谢  详情 回复 发表于 2023-4-15 08:35
回复

使用道具 举报

13#
 楼主| 发表于 2023-4-15 08:35:09 | 只看该作者
红毛樱木 发表于 2023-4-15 02:29
在FirstLogonCommands里执行:

收到,感谢
回复

使用道具 举报

14#
 楼主| 发表于 2023-4-15 08:35:37 | 只看该作者
附上最终可行的版本



<!--
具体可参考微软的文档
https://learn.microsoft.com/en-u ... -8.1-and-8/ff716114(v=win.10)
-->
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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>
                <Disk wcm:action="add">
                    <!--
                        配置第0个磁盘
                    -->
                    <DiskID>0</DiskID>
                    <CreatePartitions>
                    <!--
                    创建磁盘分区
                    Order:元素指定了分区的顺序
                    Type:元素指定了分区的类型(主分区或逻辑分区)
                    Size:元素指定了分区的大小(以MB为单位)
                    Extend:true,则创建的分区会将后面的未分配空间合并到该分区中。
                    未指定或指定为false,则创建的分区不会合并未分配空间,未分配的空间将保持为未分配状态,可以在之后的操作中进行分配。
                    -->
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>100</Size>
                            <Type>EFI</Type>
                            <!--未分配空间不合并到该分区-->
                            <Extend>false</Extend>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Size>16</Size>
                            <Type>MSR</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>3</Order>
                            <!--100G,可以自由调整-->
                            <Size>102400</Size>
                            <!--主分区-->
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>4</Order>
                            <!--主分区-->
                            <Type>Primary</Type>
                            <!--未分配空间合并到该分区中-->
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <!--
                    修改磁盘分区信息
                    Order:指定了分区的顺序
                    PartitionID:指定了分区ID
                    Format:指定分区的格式
                    Label:指定驱动器名称
                    Letter:指定盘符
                    -->
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Format>FAT32</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>3</Order>
                            <PartitionID>3</PartitionID>
                            <Label>Win</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>4</Order>
                            <PartitionID>4</PartitionID>
                            <Label>Tools</Label>
                            <Letter>D</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <!--
                    指定安装操作系统之前是否擦除磁盘。如果将此参数设置为 "true",则安装过程将擦除整个磁盘,包括磁盘上的所有分区和数据
                    如果将其设置为 "false" 或未包含在配置文件中,则安装过程将不会擦除磁盘,并且任何现有的数据或分区都将保持不变。
                    使用此设置时必须非常小心,否则可能会导致数据丢失。
                    -->
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <!--
                安装期间出现错误时显示 UI,以便用户能够了解错误的原因
                Always:始终显示UI
                onError:出错才会显示UI
                Never:从不显示UI
                -->
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <UserData>
                <!--
                WillShowUI:Never 不会显示产品密钥 UI,而是使用预先指定的产品密钥进行自动化安装。如果需要更改产品密钥,则可以在安装完成后手动添加它。
                AcceptEula:true 指定自动接受 Windows 使用条款的选项,从而避免在安装期间出现任何与使用条款相关的 UI。这也是一种自动化安装过程的方式,以确保一致性和简化安装过程。
                -->
                <ProductKey>
                    <WillShowUI>Never</WillShowUI>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <ImageInstall>
                <OSImage>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                        <!--
                        选择安装的操作系统的版本
                        安装/image/name为Windows 10 Pro的映像
                        -->
                            <Key>/image/name</Key>
                            <Value>Windows 10 Pro</Value>
                        </MetaData>
                    </InstallFrom>
                    <WillShowUI>OnError</WillShowUI>
                    <!--
                    InstallToAvailablePartitionInstallToAvailablePartition
                    true:指定将Windows安装到具有足够空间的第一个可用分区,Windows安装程序从第一个磁盘上的磁盘0和分区1开始搜索可用分区,并继续搜索所有可用磁盘。
                    false:不会自动安装 Windows 到可用分区。程序会使用Microsoft-Windows-Setup->ImageInstall->OSImage->InstallTo所指定的分区
                    -->
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
                    <InstallTo>
                        <!-- 安装在第0个盘的第3个区-->
                        <DiskID>0</DiskID>
                        <PartitionID>3</PartitionID>
                    </InstallTo>
                </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>
                <!--安装语言为 "en-US"-->
                <UILanguage>en-US</UILanguage>
                <!--安装期间不显示 UI-->
                <WillShowUI>Never</WillShowUI>
            </SetupUILanguage>
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <!--指定PC/AT增强型键盘(101/102键)-->
            <LayeredDriver>1</LayeredDriver>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Security-SPP-UX" 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">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <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">
            <RunAsynchronous>
                <!--Windows 安装期间异步执行命令-->
                <RunAsynchronousCommand wcm:action="add">
                    <!--描述-->
                    <Description>disable admin</Description>
                    <!--表示该命令将在第1个异步命令之后执行-->
                    <Order>1</Order>
                    <!-- 要执行的命令,下面命令的作用是关闭administrator帐户,active:yes是开启 -->
                    <Path>cmd /c net user administrator /active:no </Path>
                </RunAsynchronousCommand>

            </RunAsynchronous>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <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">
            <!--默认输入语言和键盘布局。在这里,"0804:00000804" 表示将默认输入语言设置为 "zh-CN"(中文,中国)-->
            <InputLocale>0804:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <!--备选语言,表示在 UI 语言不可用时,将使用英语(美国)作为备选语言。-->
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <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">

            <!--
            设置指定是否启用自动登录过程
            当安装完成后,不需要密码都会自动登录AOD用户,1次
            重启过后就要需要输入密码了
            -->
            <AutoLogon>
                <Password>
                    <Value>p@ssword</Value>
                    <PlainText>true</PlainText>
                </Password>
                <Enabled>true</Enabled>
                <LogonCount>1</LogonCount>
                <Username>AOD</Username>
            </AutoLogon>

            <OOBE>
                <!--隐藏用户许可协议页面-->
                <HideEULAPage>true</HideEULAPage>
                <!--隐藏本地帐户设置页面-->
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <!--隐藏OEM注册页面-->
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <!--隐藏在线帐户设置页面-->
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <!--隐藏无线网络设置页面-->
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <!--指定网络位置类型。可选值有Home、Work、Other。Other禁用网络发现-->
                <NetworkLocation>Other</NetworkLocation>
                <!--指定“PC安全保护”设置的级别。在此示例中,设置为“3”,即自动开启Windows防火墙并下载和安装重要更新-->
                <ProtectYourPC>3</ProtectYourPC>
                <!--不启用零售演示模式-->
                <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
                <!--跳过计算机OOBE(包括网络设置,Windows更新和其他设置)-->
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <!--跳过用户OOBE(包括设置个人首选项和设置)-->
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <UserAccounts>
                <!-- 设置administrator密码,因为关闭了administrator,所以这里密码也不用设置了
                <AdministratorPassword>
                    <Value>p@ssword</Value>
                    <PlainText>true</PlainText>
                </AdministratorPassword>
                -->

                <!--本地用户-->
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                     <Password>
                        <Value>p@ssword</Value>
                        <PlainText>true</PlainText>
                     </Password>
                     <Description></Description>
                     <DisplayName>AOD</DisplayName>
                     <Group>Administrators</Group>
                     <Name>AOD</Name>
                    </LocalAccount>
                  </LocalAccounts>
            </UserAccounts>
            <!--显示蓝牙任务栏图标-->
            <BluetoothTaskbarIconEnabled>true</BluetoothTaskbarIconEnabled>
            <!--禁用自动设置夏令时选项-->
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
            <!--禁止在任务栏中清除通知和操作中心-->
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
            <!--不显示Windows Live服务链接-->
            <ShowWindowsLive>false</ShowWindowsLive>
            <!--设置注册组织名称,即在计算机属性中查看的组织名称-->
            <RegisteredOrganization>AOD</RegisteredOrganization>
            <!--设置计算机的注册所有者名称-->
            <RegisteredOwner>AOD</RegisteredOwner>
            <!--设置时区,这里设置为中国标准时间-->
            <TimeZone>China Standard Time</TimeZone>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
回复

使用道具 举报

15#
 楼主| 发表于 2023-4-15 09:28:17 | 只看该作者
其实我们有没有QQ或微信群的,论坛发贴太没效率了
回复

使用道具 举报

16#
发表于 2023-4-21 19:48:38 | 只看该作者
谢谢提供分享
回复

使用道具 举报

17#
发表于 2023-8-31 12:00:41 | 只看该作者
兄弟 你这个能保留输入法的配置吗
回复

使用道具 举报

18#
发表于 2023-11-17 09:21:57 | 只看该作者
<Enabled>false</Enabled> 把false改为true就自动登录了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-4-28 12:31

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表