两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 |
drserver:makeddwindowswithnicdriver [2018/08/08 17:03] – liujia | drserver:makeddwindowswithnicdriver [2018/08/11 16:03] (当前版本) – liujia |
---|
| |
/Windows/panther/Unattend.xml 文件内容: | /Windows/panther/Unattend.xml 文件内容: |
<file xml Unattend> | <file xml Unattend.xml> |
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | <unattend xmlns="urn:schemas-microsoft-com:unattend"> |
<FirstLogonCommands> | <FirstLogonCommands> |
<SynchronousCommand wcm:action="add"> | <SynchronousCommand wcm:action="add"> |
<CommandLine>powershell.exe New-NetIPAddress -IPAddress "144.172.126.32" -InterfaceAlias "以太网" -PrefixLength 24 -DefaultGateway 144.172.126.1</CommandLine> | <CommandLine>powershell.exe Get-NetAdapter -Name * | ? status -eq up | Rename-NetAdapter -NewName "iEtherNet"</CommandLine> |
<Description>Description_of_command1</Description> | <Description>rename nic name</Description> |
<Order>1</Order> | <Order>1</Order> |
</SynchronousCommand> | </SynchronousCommand> |
<SynchronousCommand wcm:action="add"> | <SynchronousCommand wcm:action="add"> |
<CommandLine>powershell.exe New-NetIPAddress -IPAddress "144.172.126.32" -InterfaceAlias "以太网 2" -PrefixLength 24 -DefaultGateway 144.172.126.1</CommandLine> | <CommandLine>powershell.exe New-NetIPAddress -IPAddress "144.172.126.32" -InterfaceAlias "iEtherNet" -PrefixLength 24 -DefaultGateway 144.172.126.1</CommandLine> |
<Description>Description_of_command1</Description> | <Description>set static ip address</Description> |
<Order>2</Order> | <Order>2</Order> |
</SynchronousCommand> | </SynchronousCommand> |
| <SynchronousCommand wcm:action="add"> |
| <CommandLine>powershell.exe Set-DnsClientServerAddress -InterfaceAlias "iEtherNet" -ServerAddresses 8.8.8.8</CommandLine> |
| <Description>set dns server</Description> |
| <Order>3</Order> |
| </SynchronousCommand> |
</FirstLogonCommands> | </FirstLogonCommands> |
<UserAccounts> | <UserAccounts> |
* https://github.com/cloudbase/unattended-setup-scripts/blob/master/Autounattend.xml | * https://github.com/cloudbase/unattended-setup-scripts/blob/master/Autounattend.xml |
* https://www.starwindsoftware.com/blog/specialize-windows-server-hyper-v-guest-os-automatically | * https://www.starwindsoftware.com/blog/specialize-windows-server-hyper-v-guest-os-automatically |
| * https://blogs.technet.microsoft.com/heyscriptingguy/2012/09/06/use-powershell-3-0-to-rename-network-adapters/ |
| * https://blogs.technet.microsoft.com/heyscriptingguy/2012/11/21/use-powershell-to-configure-the-nic-on-windows-server-2012/ |