Skip to main content

Posts

Showing posts from October, 2022

PowerShell Tip : How to fetch XML Event Data log using Powershell

  So Today, one of the member of our PowerShell Forum asked me the question - How to Fetch the XML Event Data like Prop_DeviceName , Prop_ContainerID etc of a specific event ID 112 from the event log. So here is the solution for the same. In this example we will use the cmdlet Get-WinEvent and will try to grab the details. CODE : Get-WinEvent -FilterHashtable @{Logname="Microsoft-Windows-DeviceSetupManager/Admin";Id=112} -MaxEvents 1 | %{ $eventXml = ([xml]$_.ToXml()).Event $eventXml.EventData.Data } OUTPUT : You can modify the script as per your need. Happy Learning!