Created
December 21, 2017 22:48
-
-
Save tylergohl/2dd324ed67bf6d963ad6471dbac1aab6 to your computer and use it in GitHub Desktop.
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
# For auditing when updates were installed, useful for SOC 2 | |
$Session = New-Object -ComObject "Microsoft.Update.Session" | |
$Searcher = $Session.CreateUpdateSearcher() | |
$historyCount = $Searcher.GetTotalHistoryCount() | |
$Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date, | |
@{name="Operation"; expression={switch($_.operation) { | |
1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"} | |
}}} | Export-CSV c:\test.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment