====== Windows 2008 R2 SP1 的无人值守应答配置文件 ====== /Windows/panther/Unattend.xml 文件内容: false 0 007f:00000804 zh-CN zh-CN zh-CN xinNIANhao2019 true</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>2</LogonCount> <Username>Administrator</Username> </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "$wmi = Get-WmiObject -Class Win32_NetworkAdapter -Filter "netconnectionstatus=2"; $wmi.NetConnectionID = 'iEthernet'; $wmi.Put()"</CommandLine> <Description>rename nic name</Description> <Order>1</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh interface ip set address name="iEthernet" static 144.172.126.32 255.255.255.0 144.172.126.1 1</CommandLine> <Description>set static ip address</Description> <Order>2</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh interface ip set dns name="iEthernet" static 8.8.8.8</CommandLine> <Description>set dns server</Description> <Order>3</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=135 name="Block_TCP-135"</CommandLine> <Description>Block_TCP-135</Description> <Order>4</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=137 name="Block_TCP-137"</CommandLine> <Description>Block_TCP-137</Description> <Order>5</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=139 name="Block_TCP-139"</CommandLine> <Description>Block_TCP-139</Description> <Order>6</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=445 name="Block_TCP-445"</CommandLine> <Description>Block_TCP-445</Description> <Order>7</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule dir=in action=allow protocol=TCP localport=3389 name="Allow_TCP-3389"</CommandLine> <Description>Allow_TCP-3389</Description> <Order>8</Order> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow</CommandLine> <Description>Allow_ping9</Description> <Order>9</Order> </SynchronousCommand> </FirstLogonCommands> <UserAccounts> <AdministratorPassword> <Value>xinNIANhao2019</Value> <PlainText>true</PlainText> </AdministratorPassword> </UserAccounts> <OOBE> <HideEULAPage>true</HideEULAPage> <SkipMachineOOBE>true</SkipMachineOOBE> </OOBE> <TimeZone>China Standard Time</TimeZone> </component> </settings> <cpi:offlineImage cpi:source="catalog:d:/temp/install_windows server 2012 r2 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend> </file> ===== /Windows/panther/Unattend.xml 文件内容 ===== <file xml C:\Windows\panther\nic.ps1> $wmi = Get-WmiObject -Class Win32_NetworkAdapter -Filter "netconnectionstatus=2" $wmi.NetConnectionID = 'iEthernet' $wmi.Put() </file>