views:

1129

answers:

3

Is there any API for writing a C# program that could interface with Windows update, and use it to selectively install certain updates?

I'm thinking somewhere along the lines of storing a list in a central repository of approved updates. Then the client side applications (which would have to be installed once) would interface with Windows Update to determine what updates are available, then install the ones that are on the approved list. That way the updates are still applied automatically from a client-side perspective, but I can select which updates are being applied.

This is not my role in the company by the way, I was really just wondering if there is an API for windows update and how to use it.

+2  A: 

You are surely looking for the Windows Update Agent API:

http://msdn.microsoft.com/en-us/library/aa387099.aspx

Russ Bradberry
That's a COM interface oriented towards C and C++, so unless you wanted to give me a tutorial on how to call COM APIs from C#, it doesn't help me =(. Although, I'll be the first to admit that this is a failing of my knowledge, and not of your answer.
+2  A: 

The easiest way to do what you want is using WSUS. It's free and basically lets you setup your own local windows update server where you decide which updates are "approved" for your computers. Neither the WSUS server nor the clients need to be in a domain, though it makes it easier to configure the clients if they are. If you have different sets of machines that need different sets of updates approved, that's also supported.

Not only does this accomplish your stated goal, it saves your overall network bandwidth as well by only downloading the updates once from the WSUS server.

Ryan
+1  A: 

I am not aware of any C# API.

But have you consider Windows Server Update Service to help you manage Windows Update for enterprise level?

Adrian Godong