Using ASDK to create new Targets and add additional Scoping Roles of Non-Symantec Administrators
search cancel

Using ASDK to create new Targets and add additional Scoping Roles of Non-Symantec Administrators

book

Article ID: 280415

calendar_today

Updated On:

Products

Server Management Suite Client Management Suite IT Management Suite Asset Management Suite

Issue/Introduction

By default when a Target is created it is only scoped with the Symantec Administrator Role. Is it possible to add another Scoping Role to the Target so that users of that role can manage the Target as needed?

Environment

ITMS 8.7.1 and previous versions

These updates will be included and documented in 8.7.2 Help file.

Cause

New features added

Resolution

An update was made to allow Scoping Roles to be added during Target Creation and also add / removed from existing Targets. In order to use these new features a new Altiris.ASDK.NS.dll is attached to this article.

The changes made are as follows:

1. Existing method changed to support an extra XML section for target with scoping info to apply.  See the '<trustees>' node below:

<resourceTarget>
  <name>Test New Target via ASDK</name>
  <description>Created for Test Group</description>
  <mode>Computers</mode>
  <parentFolderGuid>e799a395-0879-4352-8055-08044beacff7</parentFolderGuid>                             ## Default Targets Folder
  <baseOrganizationalGroupGuid>91c68fcb-1822-e793-b59c-2684e99a64cd</baseOrganizationalGroupGuid>       ## Default Computer Org
  <targetFilters>
    <targetFilter>
      <type>Resource Collection</type>
      <operation>Intersect</operation>
      <resourceCollectionGuid>{eb3a1a12-e1c7-4431-b060-f0333e4e488c}</resourceCollectionGuid>           ## All Computers filter
    </targetFilter>
  </targetFilters>
  <trustees>
      <trustee>83d5fba1-4384-4d02-86f2-3fa9a6b90d9e</trustee>                                           ## Symantec Level 2 Workers
      <trustee>66ae44b1-e820-4c7a-a6d3-a015f9966461</trustee>                                           ## Symantec Level 1 Workers
  </trustees>
</resourceTarget>

2. New method added to adjust roles of existing target (in the same library 'lib'): "DoResourceTargetScoping(Guid targetGuid, string membership, int mode)"

 

/// <summary>
/// 
/// </summary>
/// <param name="targetGuid"></param>
/// <param name="membership"></param>
/// <param name="mode">
/// 0 - set
/// 1 - add
/// 2 - remove
/// 3 - check if any in there
/// 4 - check if all in there
/// </param>
/// <returns></returns>
[ASDKMethod]
public bool DoResourceTargetScoping(Guid targetGuid, string membership, int mode)

Notes:

The 'membership' parameter is a list of trustee guids, delimited by a comma ','
Mode values are about the way method works - set (i.e. entirely replace), add (+ new trustees), remove (- trustees).
Options 3 and 4 are to check if any or all provided trustees are in ownership of target already.

 

Attachments

Altiris.ASDK.NS.dll get_app