Reporting

 

Applies To: Windows Server Update Services

This section includes samples illustrating how to obtain, report, and act on information regarding updates and connected computers. Each sample includes step-by-step instructions on implementing the described functionality as well as complete code listings of functioning stand-alone applications. These stand-alone applications can be used as-is, or the code can be copied into an existing application.

In This Section

Sample Description
How to Approve Updates for Optional Install Approves a specified update for "optional install." This causes the update to be registered in the "Add/Remove Programs" Control Panel applet (also known as "Programs And Features" in Windows Vista and later) of the client machine. The user can choose to install the update using the Add/Remove Programs Control Panel applet.
How to Identify Computers Needing Reboot Identify computers needing reboot after approved updates have been installed. The example following the procedure is the source code for a command-line application that generates an HTML page listing all computers needing to be rebooted to complete the installation of the updates.
How to Determine Update Status for all Computers Queries the Windows Server Update Services (WSUS) server for its connected clients and their update status. The example that follows the procedure is a complete command-line application that takes this data and outputs it to an XML file for reporting purposes.
How to Determine Status for all Updates Queries the WSUS server for a list of updates and the update status for each computer client. The example that follows the procedure is a fully-functioning application that creates an XML file with a list of updates and the update status for each computer client.
How to Determine All Approved Updates Obtains a list of all approved updates for the current WSUS server. The example that follows the procedure shows a working command-line application where all approved updates are written to an XML file for reporting purposes.
How to Clean Stale Computers Procedure illustrating how to clean stale computers that have not contacted the server in a specific number of days and then either delete them or move them to the Stale Computers group. The example that follows the procedure shows a working command-line application that has command-line parameters enabling the user to control the number of days of inactivity before a computer is defined as “stale,” the action to be taken (delete or move) for any computers found to be stale, and whether or not to prompt the user before starting the delete or move procedure.
How to Get Update Details Queries the local WSUS server for detailed information for each of its updates. The example that follows the procedure obtains detailed update information and writes that data to an XML file.
How to Determine Out-Of-Compliance Computers Illustrates how to determine which computers do not have all of the approved updates installed.