Se você receber apenas o XML bruto, poderá carregar o documento XML. Como você postou um fragmento XML, presumo que ele foi exportado do log e possui uma tag raiz <Events>
. A parte complicada é o namespace.
$xml = [xml](get-content "PathToXml.xml")
$xmlns = New-Object -TypeName System.Xml.XmlNamespaceManager -ArgumentList $xml.NameTable
$xmlns.AddNamespace("el", "http://schemas.microsoft.com/win/2004/08/events/event")
$value = $xml.SelectSingleNode("/Events/el:Event/el:EventData/el:Data[@Name = 'TargetLogonId']/text()", $xmlns).Value
O XML que usei:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Events>
<Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'>
<System>
<Provider Name='Microsoft-Windows-Security-Auditing' Guid='{54849625-5478-4994-a5ba-3e3b0328c30d}'/>
<EventID>4634</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>12545</Task>
<Opcode>0</Opcode>
<Keywords>0x8020000000000000</Keywords>
<TimeCreated SystemTime='2011-08-16T17:15:38.702857400Z'/>
<EventRecordID>107947</EventRecordID>
<Correlation/>
<Execution ProcessID='680' ThreadID='972'/>
<Channel>Security</Channel>
<Computer>SRV1.DOMAIN.LOCAL</Computer><Security/>
</System>
<EventData>
<Data Name='TargetUserSid'>S-1-5-21-963414502-3093649508-813756320-3274</Data>
<Data Name='TargetUserName'>billgates</Data>
<Data Name='TargetDomainName'>MYDOMAIN</Data>
<Data Name='TargetLogonId'>0x1c01acc</Data>
<Data Name='LogonType'>10</Data>
</EventData>
</Event>
</Events>