Subject: Windows Server Update Services API Samples Readme
From: "Saved by Windows Internet Explorer 7"
Date: Fri, 27 Apr 2007 17:27:09 -0700

This document contains notes for installing the API samples and
applications for Windows Server Update Services 3.0.

Overview
The purpose of these
samples is to introduce developers and administrators to the WSUS server API. It
allows administrators and developers to control the functionality of the WSUS
server.

Getting Started
To install the
samples, run the Update Services 3.0 API Samples and Tools.exe file. The
setup program will:-

Install the samples and tools referenced in this document in
%ProgramFiles%\Update Services 3.0 API Samples and Tools folder
(install folder)

Copy this ReadMe to the install folder and create a shortcut to the ReadMe
in your All Programs menu

Copy the End-User License Agreement (EULA.rtf) for the samples to the
install folder

Each of the samples is located in a subfolder of the install
folder and contains the source code and project files for the sample, along with
a compiled version of the sample. To compile the samples you will need to use
Microsoft Visual Basic .NET 2005 or Microsoft Visual C# .NET 2005 as given
below.

Sample descriptions

Sample Name

Language

Description

ADImporter

Visual
Basic

This tool allows you to
pre-populate target groups with computers from Active Directory. The
sample application connects to the default Active Directory domain
controller, and lists the OUs and computers in the domain. It also lists
the computer groups available on the WSUS server. Using this sample, you
can select computers from Active directory and "register" the selected
computers with Update Services. Note that each computer registered must be
configured to talk to the WSUS server independently of using this tool.

ApprovedUpdatesToXML

Visual
Basic

Creates an XML file with a list of
approved updates and details of their approval including the groups that
the update is approved for, and the approval action.

ApproveForOptionalInstall

Visual
Basic

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) of the client machine. The user can choose to
install the update using the Add/Remove Programs Control Panel applet.

CleanStaleComputers

Visual
Basic

This sample application removes
computers from the WSUS server that have not contacted the server in a
specified number of days.
USAGE:
CleanStaleComputers /DAYS:[1-365]
/DELETE:{YES | NO} /PROMPT:{YES | NO}
/DAYS. Days since the computer
contacted the server
/DELETE. Delete from the WSUS server or move to
the Stale computers group
/PROMPT. Prompt before moving/deleting
computers

ComputerStatusToXML

Visual
Basic

Creates an XML file with a list of
computers on the WSUS server, and the status of the updates approved for
each computer. The list can optionally include computers that are rolled
up from downstream WSUS servers.
USAGE:
ComputerStatusToXML.exe
[IncludeDownstreamComputers]

ComputersNeedingReboot

Visual
Basic

Creates an HTML report that lists
computers that have installed updates, but still require a reboot to be
fully patched

ListApprovedUpdates

Visual
Basic

Displays a list of updates that
have been approved after a specified date and also creates a text report
that lists the updates.

UpdateStatusToCSV

Visual
Basic

Creates a simple CSV file with a
list of approved updates and a summary of the status of the updates on
each computer

UpdateStatusToXML

Visual
Basic

Creates an XML file with a list of
updates, with update status for each computer client.

UpdatesToXML

Visual
Basic

Creates an XML file with a list of
updates and information about each update, including ID, title,
description, KB articles etc.

WsusMigrate

Visual
C#

WSUS Migration Tools can assist in
migrating update approvals and target groups from one WSUS server to
another. See the ReadMe under the WsusMigrate folder for more information
on these tools.

Note: The samples are coded to expect a local WSUS server. For a
CONSOLE_ONLY installation of WSUS the code needs to be modified to use an
overloaded version of GetUpdateServer() that uses the name of the remote WSUS
server.

How to build the samples

If your WSUS server is installed to a path other than
C:\Program Files\Update Services\, then the references to the Update
Services .NET assemblies will need to be updated. To do this:

Open the project

From the menu click Project, Add Reference.

Click Browse

Browse to %Program Files%\Update Services\Service\bin,
or the install location of your WUS server.

Select microsoft.updateservices.administration.dll

Click OK.

Click OK to add the reference.

You should now be able to build the project. You'll need to
do this for each sample you want to build.