GetCollectionsWithResourcePermissions Method in Class SMS_SecuredObject
The GetCollectionsWithResourcePermissions WMI class method returns the list of collection identifiers to which the user has the specified permissions. The collection must contain the specified resource.
The following syntax is simplified from MOF code and is intended to show you the definition of the method.
uint32 GetCollectionsWithResourcePermissions(
[in] uint32 ResourceID,
[in] uint32 Permissions,
[out] string CollectionIDs[]
);
Parameters
ResourceID
Data type: uint32
Qualifiers: InUnique SMS-supplied identifier for the resource.
Permissions
Data type: uint32
Qualifiers: InSet of permissions the user has for the collections that contain the resource.
CollectionIDs
Data type: string[]
Qualifiers: OutCollections to which the user has the specified permissions.
Return Values
The GetCollectionsWithResourcePermissions method returns a uint32 that is always zero (0).
Example Code
The following example shows you how to call the GetCollectionsWithResourcePermissions method to get the list of collections that contain the resource to which the user has permissions to delete resources.
Dim Security As SWbemObject Dim Collections() As Variant Set Security = GetObject("winmgmts:root\sms\site_<sitecode>:SMS_SecuredObject") Security.GetCollectionsWithResourcePermissions <resourceid>, 512, Collections