Published: 21/08/2018
Applies to: Cayosoft Administrator 5.3 or later.
Summary: When creating a new user account with Cayosoft Administrator Web UI, attributes can be automatically generated using Attribute Policy, Generated value setting. In some cases, the functionality of Attribute Policy is not enough, and a custom PowerShell code should be used to generate a value for the target attribute, based on value of one or more source attributes. In this case, an instance of the 'AD Users | Set Attribute Value' rule is created and linked to the New User command as a 'rule to run after'.
Example
As an example, we would generation mS-DS-ConsistencyGuid attribute (target attribute), by copying the value of created ObjectGUID (source attribute).
Step 1: Create rule AD Users | Set Attribute Value to set target attribute value
- Limit scope to Domain or OU: User created in Web UI
- Query Criteria: ObjectGUID of User Created in Web UI
- Returned properties: Name,DistinguishedName,SamAccountName,UserPrincipalName,WhenCreated,<comma-separated list of source attributes>
- Example: Name,DistinguishedName,SamAccountName,UserPrincipalName,WhenCreated,ObjectGUID
- Attribute(s): <target attribute>
- Example: mS-DS-ConsistencyGuid
- Values: <PowerShell code script block code in form of { ... code ... }.InvokeReturnAsIs()>
- Example: {$FoundObject.ObjectGUID}.InvokeReturnAsIs()
Step 2: Add created rule to New User web action, the Rules to Run After list
Step 3: Optionally, specify condition when to run the rule to set attribute value
Example:
Execute If condition that checks that Other Attribute 1 value is set to "Contractor" or "Intern" values on New User wizard:
((GetSessionParameter "CreatedObjectGUID") -ne $null) -and (($CustomAttr1 -eq 'Contractor') -or ($CustomAttr1 -eq 'Intern'))
Comments
0 comments
Please sign in to leave a comment.