WDS部署windows2012的unattend文件

来源:互联网 发布:sd卡损坏怎么恢复数据 编辑:程序博客网 时间:2024/06/06 20:04

通过WDS部署windows2012:

1. 自动安装部署

2. 设置winRM

3. 设置firewall, enable remote desktop

client的unattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <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>
                <WillShowUI>Never</WillShowUI>
                <UILanguage>zh-CN</UILanguage>
            </SetupUILanguage>
            <InputLocale>zh-CN</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UILanguageFallback>zh-CN</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
        </component>
        <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">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>384</Size>
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Extend>true</Extend>
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Active>true</Active>
                            <Format>NTFS</Format>
                            <Label>System Reserved</Label>
                            <PartitionID>1</PartitionID>
                            <Order>1</Order>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Active>false</Active>
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>Never</WillShowUI>
            </DiskConfiguration>
            <DynamicUpdate>
                <Enable>true</Enable>
                <WillShowUI>Never</WillShowUI>
            </DynamicUpdate>
            <UserData>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <WindowsDeploymentServices>
                <Login>
                    <Credentials>
                        <Domain>local</Domain>
                        <Password>R00t</Password>
                        <Username>Administrator</Username>
                    </Credentials>
                    <WillShowUI>Never</WillShowUI>
                </Login>
                <ImageSelection>
                    <InstallImage>
                        <ImageGroup>WIN2012</ImageGroup>
                        <ImageName>Windows Server 2012 R2 SERVERDATACENTER</ImageName>
                        <Filename>install-(4).wim</Filename>
                    </InstallImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>2</PartitionID>
                    </InstallTo>
                    <WillShowUI>Never</WillShowUI>
                </ImageSelection>
            </WindowsDeploymentServices>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:e:/install.wim#Windows Server 2012 R2 SERVERDATACENTERCORE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>


image的unattend.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="offlineServicing">
        <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">
            <RegisteredOrganization>HP</RegisteredOrganization>
            <RegisteredOwner>Moonshot</RegisteredOwner>
        </component>
    </settings>
    <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">
            <AutoLogon>
                <Password>
                    <Value>R00t</Value>
                    <PlainText>false</PlainText>
                </Password>
                <Enabled>true</Enabled>
                <LogonCount>5</LogonCount>
                <Username>Administrator</Username>
            </AutoLogon>
            <ComputerName>%MACHINENAME%</ComputerName>
            <ProductKey>xxxxxxxxxxxxxxxxxxxxxxxx</ProductKey>
            <RegisteredOrganization>xx</RegisteredOrganization>
            <RegisteredOwner>xxxxxxxx</RegisteredOwner>
            <TimeZone>Pacific Standard Time</TimeZone>
        </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">
            <FirewallGroups>
                <FirewallGroup wcm:action="add" wcm:keyValue="FileAndPrinterSharing">
                    <Active>true</Active>
                    <Group>File and Printer Sharing</Group>
                    <Profile>all</Profile>
                </FirewallGroup>
                <FirewallGroup wcm:action="add" wcm:keyValue="WMI">
                    <Active>true</Active>
                    <Group>Windows Management Instrumentation (WMI)</Group>
                    <Profile>all</Profile>
                </FirewallGroup>
                <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                    <Active>true</Active>
                    <Group>Remote Desktop</Group>
                    <Profile>all</Profile>
                </FirewallGroup>
            </FirewallGroups>
        </component>
        <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" 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">
            <fDenyTSConnections>false</fDenyTSConnections>
        </component>
        <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" 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">
            <UserAuthentication>0</UserAuthentication>
        </component>
        <component name="Microsoft-Windows-IE-ESC" 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">
            <IEHardenAdmin>false</IEHardenAdmin>
            <IEHardenUser>false</IEHardenUser>
        </component>
    </settings>
    <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">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
            </OOBE>
            <RegisteredOwner>Moonshot</RegisteredOwner>
            <RegisteredOrganization>HP</RegisteredOrganization>
            <TimeZone>Pacific Standard Time</TimeZone>
            <AutoLogon>
                <Password>
                    <Value>UgAwADAAdABQAGEAcwBzAHcAbwByAGQA</Value>
                    <PlainText>false</PlainText>
                </Password>
                <Enabled>true</Enabled>
                <LogonCount>5</LogonCount>
                <Username>Administrator</Username>
            </AutoLogon>
            <UserAccounts>
                <AdministratorPassword>
                    <Value>UgAwADAAdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
                    <PlainText>false</PlainText>
                </AdministratorPassword>
            </UserAccounts>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <CommandLine>cmd.exe /c powershell.exe set-executionpolicy -ExecutionPolicy RemoteSigned -Force</CommandLine>
                    <Description>Enable powershell script execution</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <CommandLine>cmd.exe /c bcdedit.exe /set {bootloadersettings} ems on</CommandLine>
                    <Description>Enable EMS globally in the BootloaderSettings</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Order>3</Order>
                    <CommandLine>cmd.exe /c powercfg.exe -setacvalueindex scheme_min sub_video videoidle 0</CommandLine>
                    <Description>Disable monitor timeout to allow iLO CM - set node power off shutdown</Description>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Order>4</Order>
                    <CommandLine>cmd.exe /c powercfg.exe -setacvalueindex scheme_max sub_video videoidle 0</CommandLine>
                    <Description>Disable monitor timeout to allow iLO CM - set node power off shutdown</Description>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Order>5</Order>
                    <CommandLine>cmd.exe /c powercfg.exe -setacvalueindex scheme_balanced sub_video videoidle 0</CommandLine>
                    <Description>Disable monitor timeout to allow iLO CM - set node power off shutdown</Description>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Order>6</Order>
                    <CommandLine>cmd.exe /c powercfg.exe -setactive scheme_min</CommandLine>
                    <Description>Enable High Performance power plan</Description>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>7</Order>
                    <CommandLine>cmd.exe /c winrm quickconfig -q >C:\out1.txt</CommandLine>
                    <Description>Setting Remote Permissions</Description>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>8</Order>
                    <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"} >C:\out2.txt</CommandLine>
                    <Description>Win RM auth Basic</Description>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>9</Order>
                    <CommandLine>cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"} >C:\out3.txt</CommandLine>
                    <Description>Enable powershell script execution</Description>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>10</Order>
                    <CommandLine>cmd.exe /c winrm get winrm/config >C:\out4.txt</CommandLine>
                    <Description>Enable powershell script execution</Description>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>11</Order>
                    <CommandLine>cmd.exe /c powershell.exe Set-NetFirewallRule -DisplayGroup "远程桌面" -Enabled True</CommandLine>
                    <Description>Enable powershell script execution</Description>
                </SynchronousCommand>
<SynchronousCommand wcm:action="add">
                    <Order>12</Order>
                    <CommandLine>cmd /c winrm set winrm/config/client @{AllowUnencrypted="true"} >C:\out5.txt</CommandLine>
                    <Description>Win RM auth Basic</Description>
                </SynchronousCommand>
            </FirstLogonCommands>
        </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>zh-CN</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:e:/Images/install-2012r2.wim#Windows Server 2012 R2 SERVERDATACENTER" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 武林母情浓 物微情浓800字范文 鹣鲽情浓 爱过才懂情浓全章节目录 物微情浓作文800字 情浓恨更浓 那时情浓作文600字 物微情浓作文例子 物微情浓作文800 物微情浓600作文例子 情浓不语负海棠 情到深处爱正浓 情浓大地 台湾写真情浓女人香野味十足 爱过才懂情浓 旧时绵绵 爱过才懂情浓txt下载 谁许我情到浓时 冷灵心 情到浓时后面是什么 爱过才懂情浓免费阅读 情浓不语付棠免费阅读 第一集第九章飞凤情浓 炽情烈焰野火宝贝搞定你 焚情炽by月佩环鲤鱼乡 炽情 焚情炽 情狱 陈情令莫玄羽 无上玄神 孤情君少 花女情狂玄智慧 情玄 为情成痴作品 红尘情痴 红尘情痴歌曲 人生自是有情痴 痴爱来生情 红尘情痴原唱 情痴 蚀骨情痴乔安然 甘为情痴by小十四 蚀骨情痴乔安然付景辰 蚀骨情痴全文免费阅读