Created
November 2, 2018 00:20
-
-
Save msm-fc/88b5e3fd82830aec3531385584584e09 to your computer and use it in GitHub Desktop.
Inject new query into existing Event Viewer Custom View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region config | |
$customViewFile = "path to custom view XML file" | |
$newCustomViewFile = "path to updated custom view XML file" | |
$newQuery = "*[System[Provider[@Name='Microsoft-Windows-WAS'] and (Level=3) and (EventID=5210)]]" | |
#endregion | |
#region operations | |
[xml]$customView = gc $customViewFile | |
$customview.SelectSingleNode("//Query").InnerText = $newQuery | |
$customView.Save($newCustomViewFile) | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment