IUpdateServer.GetUpdates Method (ApprovedStates, DateTime, DateTime, UpdateCategoryCollection, UpdateClassificationCollection)
Applies To: Windows Server Update Services
Gets a collection of updates based on the specified criteria.
Namespace: Microsoft.UpdateServices.Administration
Assembly: Microsoft.UpdateServices.Administration (in Microsoft.UpdateServices.Administration.dll)
Syntax
UpdateCollection GetUpdates(
ApprovedStates approvedStates,
DateTime fromArrivalDate,
DateTime toArrivalDate,
UpdateCategoryCollection updateCategories,
UpdateClassificationCollection updateClassifications
)
UpdateCollection^ GetUpdates(
ApprovedStates approvedStates,
DateTime fromArrivalDate,
DateTime toArrivalDate,
UpdateCategoryCollection^ updateCategories,
UpdateClassificationCollection^ updateClassifications
)
abstract GetUpdates :
approvedStates:ApprovedStates *
fromArrivalDate:DateTime *
toArrivalDate:DateTime *
updateCategories:UpdateCategoryCollection *
updateClassifications:UpdateClassificationCollection -> UpdateCollection
Function GetUpdates (
approvedStates As ApprovedStates,
fromArrivalDate As Date,
toArrivalDate As Date,
updateCategories As UpdateCategoryCollection,
updateClassifications As UpdateClassificationCollection
) As UpdateCollection
Parameters
approvedStates
Type: Microsoft.UpdateServices.Administration.ApprovedStatesInclude 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
Type: System.DateTimeStart 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
Type: System.DateTimeEnd 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
Type: Microsoft.UpdateServices.Administration.UpdateCategoryCollectionAn 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
Type: Microsoft.UpdateServices.Administration.UpdateClassificationCollectionAn UpdateClassificationCollection collection that contains the classification of updates for which you want to get updates. For example, Critical Updates. This parameter can be null.
Return Value
Type: Microsoft.UpdateServices.Administration.UpdateCollection
An UpdateCollection collection of the most recent revision of any update that matches the given criteria.
Exceptions
Exception
Condition
fromSyncDate cannot be greater than toSyncDate.
Remarks
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.
Examples
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)
See Also
GetUpdates Overload
IUpdateServer Interface
Microsoft.UpdateServices.Administration Namespace
Return to top