In Configuration Manager, the GetTsPolicies Windows Management Instrumentation (WMI) class method gets all policies associated with the specified task sequence.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

SInt32 GetTsPolicies(
	 String AdvertisementID,
	 String PackageID,
	 SMS_TaskSequence TaskSequence,
	 String AdvertisementName,
	 String AdvertisementComment,
	 UInt32 AdvertisementFlags,
	 String BootImageID,
	 String SourceSite,
	 String PolicyXmls[],
	 String PolicyAssignmentXmls[]
);

Parameters

AdvertisementID


Data type: StringQualifiers: [in]A user-defined advertisement ID to embed in the policy. This ID should not conflict with other advertisement IDs that have been created by the site.
PackageID


Data type: StringQualifiers: [in]The ID for the task sequence package, if the method is to obtain policy for a task sequence stored in the Configuration Manager database. Either PackageID or TaskSequence can be non-null, but not both parameters.
TaskSequence


Data type: SMS_TaskSequenceQualifiers: [in]SMS_TaskSequence Server WMI Class object representing the task sequence. Either PackageID or TaskSequence can be non-null, but not both parameters.
AdvertisementName


Data type: StringQualifiers: [in]A user-defined name for the advertisement.
AdvertisementComment


Data type: StringQualifiers: [in]A user-defined comment for the advertisement.
AdvertisementFlags


Data type: UInt32Qualifiers: [in]User-defined flags specifying advertisement details. See SMS_Advertisement Server WMI Class for more information about these flags.
BootImageID


Data type: StringQualifiers: [in]The ID for a boot image package to use with the task sequence. This parameter is required if the TaskSequence parameter is defined. Otherwise, it must be set to null.
SourceSite


Data type: StringQualifiers: [in]Code for the source site for the advertisement.
PolicyXmls


Data type: String ArrayQualifiers: [out]XML strings representing the policy for the specified task sequence and dependent policies.
PolicyAssignmentXmls


Data type: String ArrayQualifiers: [out]XML strings representing assignments for the policy specified by PolicyXmls. PolicyXmls and PolicyAssignmentXmls are aligned, with the nth element of one parameter corresponding to the nth element of the other.

Return Values

An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.

For information about handling returned errors, see About Configuration Manager Errors.

Remarks

The policies for a task sequence include the policy for the task sequence itself, policies for all referenced packages, and corresponding policy assignments. The task sequence can be stored either in the database or in memory as a set of WMI objects.

If the task sequence is in the Configuration Manager database, your application should specify the package identifier for the task sequence package in the PackageID parameter. If supplying a value for this parameter, you must have read permission for the specific task sequence.

If the task sequence is in memory, your application must specify values for the TaskSequence and BootImageID parameters.

Requirements

Runtime Requirements

Development Requirements

See Also


Send comments about this topic to Microsoft.