Export to CSV
I have a working script. Need help exporting the data.
I know I need to use Export-Csv c:\scripts\test.txt. But having hard time understanding where to insert it?
$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"}
}}}
Another question this only show Microsoft updates "Microsoft.Update.Session"
How can I find out about other comobjects to get other updates? Adobe?
Thanks for the help.
September 9th, 2015 2:24pm
$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()
$historyCount = $Searcher.GetTotalHistoryCount()
$results = $Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date,
@{name="Operation"; expression={switch($_.operation){
1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}
}}}
$results | Out-File C:\Temp\updates.txt -Append
Add $results and the last line.
or last line as $results | Export-Csv C:\Temp\updates.csv -NoTypeInformation
-
Edited by
vaadadmin2010
12 hours 25 minutes ago
September 9th, 2015 2:39pm
Thank you. DO you know why am I missing a lot of HotFixes with this list? Is there a way to get a complete list?
September 9th, 2015 3:12pm
Thank you. DO you know why am I missing a lot of HotFixes with this list? Is there a way to get a complete list?
Like what?
I generally just use Get-HotFix instead of using the COM o
September 9th, 2015 3:15pm
Get-HotFix will not list office, lync, .NET and others, I think its just for OS.
September 9th, 2015 3:30pm
Windows update will not list Office 365 updates either.
September 9th, 2015 3:41pm
Is there a way to get compete list?
September 9th, 2015 4:17pm
You can only get the patch level for office 365 products. Interim security patches, when needed, are distributed as hotfixes and Get-HotFix gets them.
Post in O365 forums for more info on reading patch levels for Office.
September 9th, 2015 4:53pm
$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()
$historyCount = $Searcher.GetTotalHistoryCount()
$results = $Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date,
@{name="Operation"; expression={switch($_.operation){
1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}
}}}
$results | Out-File C:\Temp\updates.txt -Append
Add $results and the last line.
or last line as $results | Export-Csv C:\Temp\updates.csv -NoTypeInformation
-
Edited by
vaadadmin2010
Wednesday, September 09, 2015 6:42 PM
September 9th, 2015 6:38pm
Thanks you for the help. That is not what I am looking for. I need a scripted way to export all installed patches on the client. The script above gives me most of them, but not all. I am missing some lync, some office 2013.
Don't really understand why I am just missing some.
Thanks.
September 10th, 2015 8:59am
Thanks you for the help. That is not what I am looking for. I need a scripted way to export all installed patches on the client. The script above gives me most of them, but not all. I am missing some lync, some office 2013.
Don't really understand why I am just missing some.
Thanks.
Everything that is a patch is available from both Get-Hotfix and WU. There is no other method or any other patches.
If you don't believe this then post in Office forum or other software forum to verify.
September 10th, 2015 9:07am