0

我正在尝试让我的 WinPE 环境重命名,我目前有一个 WinPE .wim,用于通过 WDS 服务器进行部署,它配置磁盘并将相同的 WinPE 环境部署到其中一个分区中并使其可启动。但是,我需要将磁盘上不可启动的 WinPEs 主机名从随机计算机名称“MININT-******”更改为我需要的名称。

我尝试了 unattend.xml 并运行 wpeinit.exe /unattend:[path to unattend.xml]

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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">
            <ComputerName>ASDF1234</ComputerName>
        </component>
    </settings>
</unattend>

我尝试了许多 unattend.xml 的变体,wpeinit 日志文件中的每个变体都说

WPEINIT is processing the unattend file [Path]
==== Initializing Display Settings ====
No display settings specified
STATUS: SUCCESS (0x0000001)
==== Initializing Computer Name ====
Generating a random computer name
No computer name specified, generating a random name.
Renaming computer to MININT-*******.
Waiting on the profiling mutex handle
Acquired profiling mutex
Service winmgmt disable: 0x0000000
...

除了重命名系统之外,此时一切正常,当使用带有 powershell 的 Rename-Computer 时它可以工作,但是一旦它重新启动,它就会再次运行 wpeinit,这似乎会生成一个随机名称。

任何帮助将非常感激!

4

1 回答 1

0

在这一点上,我从未处理过改变这一点。但是 - 我通过 startnet / Registry 启动后更改了主机名:

@echo Windows Registry Editor Version 5.00 > set_hostname.reg
@echo\ >> set_hostname.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters] >> 
@echo "Hostname"="NEW_HOSTNAME" >> set_hostname.reg
@echo "NV Hostname"="NEW_HOSTNAME" >> set_hostname.reg
@echo\ >> set_hostname.reg

regedit /s set_hostname.reg >nul
于 2018-06-18T09:54:30.057 回答