Disable Network connection in Windows PE

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.

2
задан 2 August 2017 в 16:47
1 ответ

Эврика! Я был настолько близок, что в конце концов мне удалось заставить его работать (одна ссылка в вопросе фактически имела ответ, только для x86).

Важные извлеченные уроки:

Без лишних слов, это Unattend. xml, которая копируется процессом генерации в %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>

вызывается через модифицированную стартовую сеть. cmd

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

, что приводит к следующей записи в журнале:

2017-08-02 14:51:20.747, Info WPEINIT обрабатывает файл unattend [X:\windows\system32\Unattend.xml]

...

2017-08-02 14:51:20.982, Info ==== Инициализация доступа к сети и применение конфигурации ====

2017-08-02 14:51:20. 982, Поддержка работы в сети не будет включена.

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

ATTENTION: единственное существование файла в папке System32 приводит к его оценке. Поэтому параметр wpeinitwpeinit на самом деле не нужен, если файл находится в этом месте.

.
1
ответ дан 3 December 2019 в 12:35

Теги

Похожие вопросы