IUpdateServer.GetUpdates Method (ApprovedStates, DateTime, DateTime, UpdateCategoryCollection, UpdateClassificationCollection)
Gets a collection of updates based on the specified criteria.
Namespace: Microsoft.UpdateServices.Administration
Assembly: Microsoft.UpdateServices.Administration (in microsoft.updateservices.administration.dll)
Dim instance As IUpdateServer Dim approvedStates As ApprovedStates Dim fromArrivalDate As DateTime Dim toArrivalDate As DateTime Dim updateCategories As UpdateCategoryCollection Dim updateClassifications As UpdateClassificationCollection Dim returnValue As UpdateCollection returnValue = instance.GetUpdates(approvedStates, fromArrivalDate, toArrivalDate, updateCategories, updateClassifications)
'Declaration
Function GetUpdates ( _
approvedStates As ApprovedStates, _
fromArrivalDate As DateTime, _
toArrivalDate As DateTime, _
updateCategories As UpdateCategoryCollection, _
updateClassifications As UpdateClassificationCollection _
) As UpdateCollection
UpdateCollection GetUpdates (
ApprovedStates approvedStates,
DateTime fromArrivalDate,
DateTime toArrivalDate,
UpdateCategoryCollection updateCategories,
UpdateClassificationCollection updateClassifications
)
UpdateCollection^ GetUpdates (
ApprovedStates approvedStates,
DateTime fromArrivalDate,
DateTime toArrivalDate,
UpdateCategoryCollection^ updateCategories,
UpdateClassificationCollection^ updateClassifications
)
UpdateCollection GetUpdates (
ApprovedStates approvedStates,
DateTime fromArrivalDate,
DateTime toArrivalDate,
UpdateCategoryCollection updateCategories,
UpdateClassificationCollection updateClassifications
)
function GetUpdates (
approvedStates : ApprovedStates,
fromArrivalDate : DateTime,
toArrivalDate : DateTime,
updateCategories : UpdateCategoryCollection,
updateClassifications : UpdateClassificationCollection
) : UpdateCollection
- approvedStates
Include updates that match the specified approved state. You can specify one or more states. For example, specify LatestRevisionApproved to include only the updates with the latest revision that are approved.
- fromArrivalDate
Start date and time to search for updates. Updates synchronized on or after this date and time are included in the collection. To avoid filtering updates based on a start date, specify DateTime.MinValue. You must specify the date in Coordinated Universal Time.
- toArrivalDate
End date and time that is used to search for updates. Updates synchronized on or before this date and time are included in the collection. To avoid filtering updates based on an end date, specify DateTime.MaxValue. You must specify the date in Coordinated Universal Time.
- updateCategories
An UpdateCategoryCollection of categories that contains the product categories for which you want to get updates, for example, the Windows family. This parameter can be null.
- updateClassifications
An UpdateClassificationCollection collection that contains the classification of updates for which you want to get updates. For example, Critical Updates. This parameter can be null.
An UpdateCollection collection of the most recent revision of any update that matches the given criteria.
The following example shows how to get a collection of updates that represent the latest approved revision for any time, any category, and any update classification.
Dim updateCollection As UpdateCollection
updateCollection = updateServer.GetUpdates(ApprovedStates.LatestRevisionApproved, Date.MinValue, Date.MaxValue, Nothing, Nothing)
Exception type | Condition |
---|---|
ArgumentOutOfRangeException | fromSyncDate cannot be greater than toSyncDate. |
updateCategories and updateClassifications can both be null, in which case the return will not be filtered by categories or update classifications or both.
This search method will search on and return only the most recent revision of any update. For example, if an update was added on Monday and revised on Tuesday, and toSyncDate includes Monday but not Tuesday, the update would not be returned. To get all updates, call GetUpdates.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows Server 2008, Windows Server 2003, Windows Server 2008 R2
IUpdateServer Interface
IUpdateServer Members
Microsoft.UpdateServices.Administration Namespace