大网数据广告活动
服务器运维问答

Disable Network connection in Windows PE

· 52CE 我爱测

I am generating a WindowsPE boot stick with the Microsoft Automation Installation Kit 10 (host is Windows 10) for a amd64 target platform. Because i dont need network connections from within the WinPE, id like to completely and s…

问题原文

原帖链接 · BNT · CC BY-SA 3.0

I am generating a WindowsPE boot stick with the Microsoft Automation Installation Kit 10 (host is Windows 10) for a amd64 target platform.

Because i dont need network connections from within the WinPE, id like to completely and securely disable them.

I have a rough understanding of the WinPE bootchain so i know that i can pass a configuration file to wpeinit which would allow me to disable the network. The 10 year old mystery remains: how would that file have to be structured? A minimal example of

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <EnableNetwork>false</EnableNetwork>
</unattend>

does not throw an error message but also does not work. Its called from within startnet.cmd like this:

wpeinit -unattend:"%SystemRoot%\system32\Unattend.xml"

allthough i also have seen wpeinit /unattend: ....

The %SystemRoot%\system32\wpeinit.log logfile states:

2017-08-02 13:26:16.061, Info WPEINIT is processing the unattend file [X:\windows\system32\Unattend.xml]

...

2017-08-02 13:26:16.295, Info ==== Initializing Network Access and Applying Configuration ==== 2017-08-02 13:26:16.295, Info No EnableNetwork unattend setting was specified; the default action for this context is to enable networking support.

The provided examples dont help me much either, i think this might be for automated installation, not configuration.

I verify that networks are disabled via the following commands

netsh interface ipv4 show interfaces
netsh interface ipv6 show interfaces

There is the possibility of disabling the connection via netsh like

netsh interface set interface "Local Area Connection" DISABLED

but im afraid that WinPE might have tried to access a DHCP already or was reachable via network for a short period of time.

So how can a networkless WinPE be achieved? Thanks!

Is not calling wpeinit from startnet.cmd an option since i need devices initialized with their drivers? Some posts suggest so.

已采纳解答

原帖链接 · BNT · CC BY-SA 3.0

Heureka! I was so close that i finally managed to get it working (one reference in the question actually had the answer, only for x86).

Important lessons learned:

Without further ado, this is the Unattend.xml which gets copied by the generation process to %SystemRoot%\system32:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="AMD64">
            <EnableNetwork>false</EnableNetwork>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

called via the modified startnet.cmd

wpeinit /unattend="%SystemRoot%\system32\Unattend.xml"

which leads to the following log entry:

2017-08-02 14:51:20.747, Info WPEINIT is processing the unattend file [X:\windows\system32\Unattend.xml]

...

2017-08-02 14:51:20.982, Info ==== Initializing Network Access and Applying Configuration ====

2017-08-02 14:51:20.982, Info Networking support will not be enabled.

2017-08-02 14:51:20.982, Info STATUS: SUCCESS (0x00000001)

ATTENTION: the sole existance of the file in the System32 folder leads to its evaluation. So the parameter to wpeinit is actually not needed if the file resides at that location.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。