找回密码
 注册
查看: 1361|回复: 0

windows2019 镜像 sysprep系统清理时 配置 Unattend.xml文件

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-30 10:32:40 | 显示全部楼层 |阅读模式
<?xml version="1.0" encoding="utf-8"?>$ |% @2 b; O5 Z2 j) l
<unattend xmlns="urn:schemas-microsoft-com:unattend">+ Y: Z6 C+ X/ S5 D# C
    <settings pass="windowsPE">
$ e: F, O9 O' f% o, i$ [        <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">
9 u4 u  M9 ^3 }6 F. \& n4 W            <SetupUILanguage>
. S! {0 l. p$ p                <UILanguage>en-US</UILanguage>  J& K3 n/ q* T4 d" F* N
            </SetupUILanguage>
, Y& ^- P. |4 G! n! V- C            <InputLocale>en-US</InputLocale>& q7 L/ }' ^- k7 X
            <SystemLocale>en-US</SystemLocale>  l3 U# Y" U4 b' ?# E" `! V: _
            <UILanguage>en-US</UILanguage>' f, a8 g, O& D' M' k' U* _
            <UserLocale>en-US</UserLocale>
! f! v2 m- A# P2 D$ `# Z' j        </component>
& ^+ s: c, \$ x        <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">8 l# k: H  [0 V/ w/ B! y6 w
            <DiskConfiguration>4 s( `$ x6 {- {+ v& N
                <Disk wcm:action="add">3 x9 z) ?* S/ ~, H4 S" _
                    <CreatePartitions>
* |, U* _0 W( S3 ^% u- }                        <CreatePartition wcm:action="add">
2 E  S4 e  U2 ]- l: ]% A5 c                            <Order>1</Order>8 g, m. M0 @, J
                            <Size>250</Size>
3 t# R. {+ N- [9 N* A) ^                            <Type>Primary</Type>
/ O7 N( y4 f  ~                        </CreatePartition>
& o' b4 I8 M& e  x1 ]* i                        <CreatePartition wcm:action="add">; X# x; N9 l- `: h
                            <Order>2</Order>( A% R; z. m+ [$ k* m% C6 e% Y0 k7 I
                            <Extend>true</Extend>+ ?5 F0 I& a/ t6 O, Z. |
                            <Type>Primary</Type>. Y" Z$ S% b; a; Q. x7 w
                        </CreatePartition>8 q. ?# j: z/ k) _6 G3 k
                    </CreatePartitions>" U8 H. ~; K8 Q# Q2 b$ ]+ F6 T
                    <ModifyPartitions>2 q8 h8 d; C6 N) y* n& w, U
                        <ModifyPartition wcm:action="add">
4 r6 O" ~" |: i3 I! B" Y                            <Order>1</Order>
9 }$ r3 [" {# r% U( g                            <PartitionID>1</PartitionID>
$ Z& j+ o6 y; t( x& i                            <Format>NTFS</Format>
5 c& H/ Y. w4 V9 ]: H8 q; C$ E                            <Label>Boot</Label>8 U4 X8 D  |$ x6 p, K
                            <Active>true</Active>
" d5 A6 y5 W8 n0 ?. l                        </ModifyPartition>2 k- x+ z$ H/ r9 a! \
                        <ModifyPartition wcm:action="add">" k9 s/ w. r2 T: p
                            <Order>2</Order>2 I/ B0 Q: N6 w: I8 K
                            <PartitionID>2</PartitionID>
" A1 _/ p* S6 e& Z! ?# Y                            <Format>NTFS</Format>
+ m! Z: B$ I9 a                            <Label>System</Label>% e) @: ]0 E& T; |
                        </ModifyPartition>- Q( w/ M- x' X: X+ M/ x% N
                    </ModifyPartitions>& }! Q+ q5 W+ b/ x; K. p6 ]
                    <DiskID>0</DiskID>2 V! L# Z& O$ H& U/ ~
                    <WillWipeDisk>true</WillWipeDisk>* K9 n; S8 n* |0 v
                </Disk>
; J6 Y9 R. f1 u$ ~1 s! T5 ?# d* P            </DiskConfiguration>
, M! n6 M8 k& [, n# A5 {# i            <ImageInstall># T* f$ |& K3 b& ?+ {
                <OSImage>
: O7 R7 x! |* ~. m( L0 _' [                    <InstallFrom>, u7 k' v. d6 V
                        <MetaData wcm:action="add">
4 v! Y( f$ ^9 u+ M! _3 f6 g                            <Key>/IMAGE/NAME</Key>; y6 V0 }4 b6 l" M5 D2 t
                            <Value>Windows Server 2019 SERVERSTANDARD</Value>
" m0 b* ?- D7 C, D9 J$ V                        </MetaData>
9 n) H/ I9 j4 G: m& }3 d                    </InstallFrom>
9 E" G8 }" w2 n: p( }                    <InstallTo>
, H: q1 K: q( \5 z                        <DiskID>0</DiskID>( h: b; y# W  R( T
                        <PartitionID>2</PartitionID># f' u+ ]0 C" V. A. z
                    </InstallTo>  n+ W7 X( p$ g& Q$ Q% h" R
                    <WillShowUI>OnError</WillShowUI>* T2 u7 d0 W7 u5 P
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
" @# k$ B2 X7 {; B( Z0 |                </OSImage>; S- }& M8 S$ A3 n, T: A! R) R
            </ImageInstall>- ?$ W" u- f  _' U
            <UserData>
. B+ s9 S* K( o                <AcceptEula>true</AcceptEula>
% G- f. R9 F- u% X7 D    <ProductKey>
7 ~; B( ?& i* }* C& ~                  <Key>11111-22222-33333-44444-55555</Key>2 g' F4 C9 c4 S
                  <WillShowUI>Never</WillShowUI># Q$ D6 \/ |$ ?4 g4 c3 N$ b
               </ProductKey>
/ J/ z  S+ w; D! v2 V            </UserData>
2 d; m& \: U! s  J        </component>
% i) J  E# i1 r( w    </settings>
2 a8 N6 E" H* P4 Z    <settings pass="specialize"># \, }# t0 M- U9 O# J. C" T6 u
        <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"># t2 F. d, D7 c+ ?6 c/ e
            <TimeZone>Central Standard Time</TimeZone>
' x& D$ K  N+ m& m# Y7 z) f4 Y5 K, l        </component>
) u# `! G- x% @8 c/ `$ e3 ?& Q        <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">0 |* _, t; Y9 A
            <RunSynchronous>( t! x$ s( `6 ?4 u% ~
                <RunSynchronousCommand wcm:action="add">6 H0 u4 @) q' a6 U/ `
                    <Path>a:vmtools.cmd</Path>
# a4 O& k+ v% I3 M+ [7 f* E6 ]                    <Order>1</Order>
/ q! e! g) N8 X2 ^8 X9 c                    <WillReboot>Always</WillReboot>
" Q5 D( F6 I1 Q- t8 M                </RunSynchronousCommand>4 Y0 h) c9 p. B! _
            </RunSynchronous>3 [; A( r# s( t1 @5 N5 a" }/ c) o6 N
        </component>
& [4 f5 I9 Y( }    </settings>
) M+ B! c- T2 W0 j$ k    <settings pass="oobeSystem">8 x# I) P) {3 g. v0 J% s  H
        <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">+ A: p3 |- e5 K$ y# l8 c
            <AutoLogon>0 H: Q- G0 g: }* F0 ]2 Z. H
                <Password>' P+ n  }  _" U
                    <Value>"your password"</Value>& V1 S7 L% H8 T& u2 P
                    <PlainText>true</PlainText>, c7 u6 C" T" H
                </Password>/ E1 T" c# _% N; c# F/ ~
                <LogonCount>2</LogonCount>$ L/ }. Q9 g- n% g
                <Username>Administrator</Username>
# f2 m3 z, a- v% f4 u; {                <Enabled>true</Enabled>
' ~0 Z: ~( O% j* Z) g            </AutoLogon>5 E: i8 |0 n$ E9 o! \( S0 i2 G5 s
            <FirstLogonCommands>' u6 ]" {; ^( ]) V8 z$ f. G4 h; M
                <SynchronousCommand wcm:action="add">6 U$ [, }' ?' _
                    <Order>1</Order>2 Y' B. p( r/ i' P3 ^5 X; W
                    <!-- Enable WinRM service -->
+ w/ P7 M- N2 H4 e2 r, o) s                    <CommandLine>powershell -ExecutionPolicy Bypass -File a:configureVM.ps1</CommandLine>5 z- H4 Y! D" n
                    <RequiresUserInput>true</RequiresUserInput>
# v6 V/ F3 s0 f- \" ?6 W                </SynchronousCommand>
# R1 l' a1 i* I& ~& E* [5 K6 B            </FirstLogonCommands>
1 h0 r+ |( H9 R            <UserAccounts>3 G$ |# n9 ^9 G# O- P
                <AdministratorPassword>
7 C0 v! ]6 r, N7 g' V' g6 M- H                    <Value>"your password"</Value>& m9 G& b9 ?7 O7 V( n, C
                    <PlainText>true</PlainText>7 v  L( m! v- f- w6 B+ o
                </AdministratorPassword>9 \" I% B* f0 W" C( c' a, h. O
            </UserAccounts>
4 R4 D2 v5 [8 D5 b, i        </component>
0 F9 r: n5 J5 j! ^. G    </settings>
# q% m: g  g$ S" t( j# U" c- ]    <cpi:offlineImage cpi:source="wim:c:/users/administrator/desktop/win2019/install.wim#Windows Server 2019 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />! ~1 }, ]% S' M; i0 T
</unattend>
4 z+ C" q. n- z1 i2 O2 E6 C6 N
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:59 , Processed in 0.017053 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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