想要将特定任务附加到 wifi 适配器断开连接事件,但需要(刚断开连接的)适配器标识(名称、guid 等)。不幸的是,它不存在于生成的 4004 事件中。可能存在多个 wlan 适配器,因此盲目地从系统中读取 wlan 适配器的名称并不是合适的解决方案。有没有办法将此(或其他)事件映射到相关的网络适配器或配置文件?
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Microsoft-Windows-NetworkProfile" Guid="{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}" />
<EventID>4004</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x4000000000000000</Keywords>
<TimeCreated SystemTime="2024-02-12T09:17:28.1702393Z" />
<EventRecordID>9047</EventRecordID>
<Correlation />
<Execution ProcessID="1968" ThreadID="2216" />
<Channel>Microsoft-Windows-NetworkProfile/Operational</Channel>
<Computer>MACHINE</Computer>
<Security UserID="S-1-5-19" />
</System>
- <EventData>
<Data Name="NewInternetConnectionProfile">false</Data>
<Data Name="ConnectionCostChanged">false</Data>
<Data Name="DomainConnectivityLevelChanged">false</Data>
<Data Name="NetworkConnectivityLevelChanged">true</Data>
<Data Name="HostNameChanged">false</Data>
<Data Name="WwanRegistrationStateChanged">false</Data>
<Data Name="TetheringOperationalStateChanged">false</Data>
<Data Name="TetheringClientCountChanged">false</Data>
</EventData>
</Event>