Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
The XML I posted was from the collector. The doubletake job event 6101 includes the vm name and node in the same element which is why I have to parse it to get he vm name. The node also has its own element so I can do this and it works.
The VM name is in the DATA elements. That is how it gets displayed in the message. The source computer name for the event is in the "COMPUTER" element of the SYSTEM elements in the XML. That is hw the event system works
SYSTEM
<EventID Qualifiers="16384">6101</EventID>
<Computer>myHyper-V.Node</Computer>
EVENTDATA
<Data>MyVM to myHyper-V.Node</Data>
<Data>10.83.72.138</Data>
$xmlevent.Event.EventData.Data[0] is the insert string for the message
<Message>The job "MyVM to myHyper-V.Node" (ID ....
This topic is 6 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.