Skip to content

WriteDiscoveredAccount

RobertCroteau edited this page Jun 23, 2020 · 18 revisions

A mechanism for the script to return account discovery information to the client.

Parameters

Parameter Name Description Required
Name The name of the account Yes
UserId The ID of the account No
GroupId The group ID of the account No
Groups The list of groups for this account, see below No
FilterQuery A Dictionary of filtering rules, see below No

Groups

Parameter Name Description Required
Name The name of the group No
Id The ID of the group No

FilterQuery

Parameter Name Description Required
Rules Array of rules Yes
UserName The Rule for UserName, '' for all Yes
UserId The Rule for UserId, '' for all Yes
Group The Rule for Group, '' for all Yes
GroupId The Rule for GroupId, '' for all Yes
RelativeId The Rule for RelativeId, '' for all Yes

Example:

{
  "WriteDiscoveredAccount": {
    "Name": "Tom",
    "UserId": "1234",
    "Groups": "[ { 'Name': 'groupName1' }, { 'Id': '654' }, { 'Id': '987', 'Name': 'groupName3' }, ]",
    "FilterQuery": "{'Rules': [{'Name':'any UserId > 0','Type':'Constraints','Filters':{'UserName':'','UserId':'1-9223372036854775807','Group':null,'GroupId': '','RelativeId': null}}]}"
  }
}

Example two:

  {
    "SetItem": {
      "Name": "GroupList",
      "Value": "%{new List<DiscoverGroup>();}%"
    }
  },
  {
    "Eval": {
      "Expression": "%{GroupList.Add(new DiscoverGroup{Name=GroupName, Id=GroupId})}%"
    }
  },
  {
    "WriteDiscoveredAccount": {
      "Name": "%AccountName%",
      "UserId": "%AccountUID%",
      "GroupId": "%AccountGID%",
      "Groups": "%{GroupList}%",
      "FilterQuery": "{'Rules': [{'Name':'All','Type':'Constraints','Filters':{'UserName':'','UserId':'','Group':'','GroupId':'','RelativeId':''}}]}"
    }
  }

Example three:

  {
    "SetItem": {
      "Name": "GroupList",
      "Value": "%{new List<DiscoverGroup>();}%"
    }
  },
  {
    "Eval": {
      "Expression": "%{GroupList.Add(new DiscoverGroup{Name=GroupName, Id=GroupId})}%"
    }
  },
  {
    "WriteDiscoveredAccount": {
      "Name": "%AccountName%",
      "UserId": "%AccountUID%",
      "GroupId": "%AccountGID%",
      "Groups": "%{GroupList}%"
    }
  }