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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-30 10:32:40 | 显示全部楼层 |阅读模式
<?xml version="1.0" encoding="utf-8"?>
8 y9 i8 x5 Z; M: |<unattend xmlns="urn:schemas-microsoft-com:unattend">
  q3 M1 T/ x9 p8 H9 @7 s5 e9 f    <settings pass="windowsPE"># N2 A$ j# S+ C8 L/ f  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">
: E5 S* P5 ~& W            <SetupUILanguage>
) b) s. _% F6 x: L/ _                <UILanguage>en-US</UILanguage>! t  A" k1 d5 P. A5 Y
            </SetupUILanguage>6 v6 U0 a+ }) d  P/ o
            <InputLocale>en-US</InputLocale>( f: N$ r0 ?5 Q, u7 p  _8 ^' h$ I
            <SystemLocale>en-US</SystemLocale>
8 B, r7 t8 z3 e; e9 P- W            <UILanguage>en-US</UILanguage>+ g0 S. F& g7 W" s5 E! q0 t" N# j
            <UserLocale>en-US</UserLocale>. q; g% y/ _6 [' o
        </component>/ g2 Q) |5 ^  o' c
        <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">
1 K  @3 h8 t- u! y; {' Q            <DiskConfiguration>' H2 G3 [! ~. T3 V5 k
                <Disk wcm:action="add">" U3 G+ n- g+ u; w1 P+ i! N
                    <CreatePartitions>3 B# |7 O- L1 ~2 T0 b. G, _
                        <CreatePartition wcm:action="add">
* P' ]$ |! H; c% P7 C" w$ E7 |                            <Order>1</Order>
& U/ N% K2 u4 C, T/ x; e                            <Size>250</Size>7 G5 ^9 c1 h/ p6 r. e
                            <Type>Primary</Type>9 W# o& f& W3 S) l, H: q% h, L
                        </CreatePartition>' Y! ?( C' k4 _, X( r& x7 u
                        <CreatePartition wcm:action="add">  Y$ R. N/ p0 l" W+ w6 l7 M0 U9 Q
                            <Order>2</Order>
2 O+ d' D4 u  w3 [  H3 d8 `                            <Extend>true</Extend>3 y7 p' D' o5 Q5 b. h0 }" s5 P3 d
                            <Type>Primary</Type>. L7 @- _9 M" B! C8 A: n
                        </CreatePartition>
. j9 }, E/ X7 Y1 I& ?                    </CreatePartitions>
) ^% A: F# g/ @* b                    <ModifyPartitions>7 v9 o/ B% o2 j# i2 u6 W0 W' b
                        <ModifyPartition wcm:action="add">* I# D. j9 ?/ u) m/ P( Z
                            <Order>1</Order>" O- B+ \0 q: N% V( T& i
                            <PartitionID>1</PartitionID>
1 C2 u+ n- ?( w2 n                            <Format>NTFS</Format>' ]- R1 ]1 V. W" \; E& l# S( u, c& w
                            <Label>Boot</Label>/ X9 l0 N" k3 `( f; R
                            <Active>true</Active>: E- z! `/ X* p3 b# e4 d+ C- a' `
                        </ModifyPartition># D( N1 P5 f. T# E1 E6 [! l
                        <ModifyPartition wcm:action="add">8 a4 B) S8 {7 ]3 i+ y1 i$ K: D
                            <Order>2</Order>& S' Y4 Y: K; U8 f/ P# Y9 r4 T, C
                            <PartitionID>2</PartitionID>( v' B8 Q' m1 Z) p
                            <Format>NTFS</Format>
0 E- O7 K$ q( L' U9 j! y: q: S6 Z                            <Label>System</Label>
4 T  v4 P; d/ U+ u  y1 C! N                        </ModifyPartition>
, e$ L$ q5 ]( u# H! a                    </ModifyPartitions>
4 Z9 Q! a& r" Q- u) `                    <DiskID>0</DiskID>
6 {! Y; n* D) H7 R- A" w6 E% |, ]                    <WillWipeDisk>true</WillWipeDisk>( e( J" A6 \) I  D% f$ I
                </Disk>
0 `  J0 j' S) P0 G% S) s6 r            </DiskConfiguration>
3 C- ~8 y* M3 a. b9 U8 N& v7 x( s            <ImageInstall>
3 U4 n- S2 e# ]" \, y. E9 h                <OSImage>
0 w5 g3 R  o3 k3 ]                    <InstallFrom>
& ~# W. n2 Z& b& z( r- d7 E                        <MetaData wcm:action="add"># v9 j2 T( _( E
                            <Key>/IMAGE/NAME</Key>& \( j% R" T- c# C
                            <Value>Windows Server 2019 SERVERSTANDARD</Value>' j8 ~! v  j5 X
                        </MetaData>
0 q+ `+ `  x1 a& X- N3 l6 n5 _                    </InstallFrom>
, H/ \! D4 j% q3 h1 _% T                    <InstallTo>7 P8 }& w' N; q
                        <DiskID>0</DiskID>
' f% V; ?4 T* P- H8 j9 m1 ^                        <PartitionID>2</PartitionID>
/ j) ?$ S' j  \7 z' Z# h                    </InstallTo>" k2 ^. u( f. B  r' p, i0 u& H2 B
                    <WillShowUI>OnError</WillShowUI>% H* p! h" d0 d+ `
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
$ L  {. Y- l4 H6 B9 N9 S                </OSImage>
: A& o. P( Y3 \% u            </ImageInstall>& E5 ^- G5 Q1 R
            <UserData>
5 F" S8 D, H- ]; B/ o                <AcceptEula>true</AcceptEula>' ]5 _' S; M- c$ e# Q: Y' @
    <ProductKey>
6 u8 s& ~  E& R% C( J                  <Key>11111-22222-33333-44444-55555</Key>
) W6 f+ `( K. H5 b" b                  <WillShowUI>Never</WillShowUI>
6 b' @) U9 P/ G$ e               </ProductKey>
7 ?/ X% i; V( [3 G+ K            </UserData>
% f! `) ?! m/ q& Z' p        </component>' s# h& P3 j1 \: [% T
    </settings>
7 V: D* _, q) V  d' l  O    <settings pass="specialize">: r, n" G/ v3 O( y; Y( w
        <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"># {9 i* }9 ?7 `- T
            <TimeZone>Central Standard Time</TimeZone>3 P  v/ a& l& J# {
        </component>
7 A4 [# `* \( `6 e- K        <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 z$ e4 w$ g( k4 K. H; A
            <RunSynchronous>' W. F0 Y9 l5 q
                <RunSynchronousCommand wcm:action="add">1 S8 j* s" J6 E1 j7 h. u* l6 y3 c: f
                    <Path>a:vmtools.cmd</Path>
' ?  ~( Z; o3 y                    <Order>1</Order>  i: P7 O5 R( R* P2 F# d
                    <WillReboot>Always</WillReboot>
* D8 T5 V" U  [: e                </RunSynchronousCommand>7 q' I) N, T3 i& E6 ~$ G
            </RunSynchronous>! L4 K: T$ `, ^) t
        </component>- p$ S  \$ c8 v! _# N5 v
    </settings>' Q  H& e: h3 w7 d  R
    <settings pass="oobeSystem">+ t5 f3 n  _, C6 j) M' i
        <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">) I1 S1 n( R$ |" _2 N# A& `
            <AutoLogon>
% ~. c% g, o7 J8 K                <Password>$ n; R/ O; `) O9 d
                    <Value>"your password"</Value>
. k7 ~4 K5 s( l' O3 `                    <PlainText>true</PlainText>6 X2 R% Y3 D$ \6 g5 j; V
                </Password>' \/ x5 \( ~3 w! F
                <LogonCount>2</LogonCount>4 Z8 \# a) `9 H) D3 Q" `. B% d7 ^; N
                <Username>Administrator</Username>! ]  Z" o% Q, A
                <Enabled>true</Enabled>
* G2 R6 d; V1 P. s            </AutoLogon>/ y: Q) v2 }5 s  u" S! E
            <FirstLogonCommands>
& r) f7 ]& k9 n  n) ]  D                <SynchronousCommand wcm:action="add">
+ o9 S: X& C# D2 w& x$ Q/ `                    <Order>1</Order>
& ~1 G! \) K, f3 G' m' L1 J                    <!-- Enable WinRM service -->+ a; `* T0 d  Y7 q( Y  t+ |
                    <CommandLine>powershell -ExecutionPolicy Bypass -File a:configureVM.ps1</CommandLine>
$ w. o# m: }- f' [/ f5 Q                    <RequiresUserInput>true</RequiresUserInput>$ U+ N4 `1 {' U4 y, p. V: A" [+ e
                </SynchronousCommand>
! W/ o/ m' f/ v$ N- I# ~  T            </FirstLogonCommands>
: P7 U" U3 O6 n, x" u1 P. A- Q; F            <UserAccounts>
* `2 e3 O* {- S8 K( j                <AdministratorPassword>
9 U& s. w' b9 Y* K$ v) ?' e2 E                    <Value>"your password"</Value>
9 J7 W0 X( p/ w. ]: x4 s) c                    <PlainText>true</PlainText>3 G! E% g' Q, V
                </AdministratorPassword>
8 h) ^$ d6 T& y0 ]. S' \            </UserAccounts>
/ }0 {8 {& s# c" j0 n        </component>0 w, q( D: s5 p" v2 p% X% x
    </settings>1 r% }6 V- X+ x0 D. i
    <cpi:offlineImage cpi:source="wim:c:/users/administrator/desktop/win2019/install.wim#Windows Server 2019 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
7 z2 p! g) K) P</unattend>. \( y$ R, I0 t/ B' J  r. h* l
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 04:21 , Processed in 0.016294 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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