Exporting WSUS data to Excel
In addition to generating update reports in PowerShell, the results can also be exported into Excel or other tools. By exporting the update or inventory reports to Excel, we can use a familiar tool to view, filter, and display the information in ways that are useful to us.
Getting ready
In this recipe, we will be using the process in the prior recipe to query the update server database. We will then return the resulting dataset and export it into a format that Excel can utilize.
How to do it...
Carry out the following steps to export WSUS data to Excel:
Create the dataset object. This is the same process as the Creating an update report recipe.
Export the dataset to an XML file:
$ds.Tables[0].WriteXml("C:\temp\inventory.xml")
Open the XML file with Excel:
How it works...
We start by collecting the inventory information as in the prior recipe. Once the database has been queried, it returns a dataset object, which is capable of hosting multiple tables. We instruct PowerShell...