- Related Products
- ADAudit Plus
- ADSelfService Plus
- EventLog Analyzer
- Exchange Reporter Plus
- AD360
- Log360
Macros are special strings whose values are replaced with another string according to the function of that macro. ADManager Plus supports different types of macros that parses dynamic values whenever they are used in execution.
For example: In the macro %sAMAccountName%, the input values would be the SAM account name of the objects on which the macro is executed.
While using macros in ADManager Plus, it's essential to follow the syntax as outlined below. According to the category or type of the macro, the prefix will vary.
Type of macro | Prefix | Available macros |
---|---|---|
Action details | act |
|
Environment variable | env | Configured under the Environment Variable tab. |
Custom functions | fx |
|
Utility | - | |
AD attributes | ad |
|
Microsoft 365 attributes | m365 |
Click the macro selector icon in the modules listed below that support macros, and configure them as needed.
While using macros in ADManager Plus it is recommended to follow the tips mentioned below.
Nested macros in ADManager Plus allows for a macro to be embedded or called inside another macro. You can use nested macros by enclosing the inner macro with #. The environment variable, find and replace macros, encode and decode URI component macros are examples of nested macros.
Example:
Active Directory (AD) attribute macros allows you to get the LDAP values of user and group objects on which the macro is being executed dynamically. By default, twenty AD attributes are available as macros in ADManager Plus. If you want to add custom attributes, configure that under Admin > LDAP Attributes. While adding custom attributes, make sure they are associated with the relevant report category.
These macros allow you to get the Microsoft 365 attribute values of user and group objects on which the macro is being executed dynamically. By default, 18 Microsoft 365 attributes are available as macros in ADManager Plus.
Timestamp macros are placeholders or variables used to represent specific date and time values dynamically. To use this macro, select the Timestamp macro under Action Details and specify the date and time format for the values to be updated in real time whenever the macro is used.
For example,
When automating user onboarding tasks, you can set the start date for user account creation to be two days after the automation configuration by using the timestamp macro as shown below.
Syntax:
%act.timestamp_<dateformat>_<timeinterval type>_<timeinterval value>%
Example:
%act.timestamp_ dd-MM-yyyy _after n days_2%
Input value | Output value |
---|---|
If the current date during macro parsing is: 01-01-2025 | 03-01-2025 |
An environment variable is a name or value pair that can be used as macros for values that rarely change, like Authtoken, IDs, etc. They can be used in the place of URL, Header, Parameter, and Message Body while creating a new webhook template.
Syntax
%env.<Variable name>%
Example
%env.securedToken%
Input value | Output value |
---|---|
%env.securedToken% | sd#123#78sd |
Create custom functions whose value is retrieved from a script. The resulting value from the script execution while the variable macro is parsed will be used as the value of the custom function.
Syntax
%fx.<Variable name>_<Argument 1>_...<Argument n>%
Example
%env.generateSecuredToken_#%act.timestamp_dd-MM-yyyy_current time%#_%admin%
Input value | Output value |
---|---|
%env.generateSecuredToken_#%act.timestamp_dd-MM-yyyy_current time%#_%admin% | The generateSecuredToken script path will be added here.
The execution time will follow the dd-MM-yyyy format (e.g., 01-01-2024) as the first argument, with admin as the second argument. Both values will be parsed in the script, and the script's output will become the macro's value. |
Find and replace macro helps you search and find a specific part of the source string and replace it with another string. In ADManager Plus, you can find and replace source strings and macros. To use this, in the Select Macros pop-up window, go to Functions > Find and Replace.
Syntax
%func.findAndReplace("#%ad.OU_DN_NAME%#","<find value>","<replace value>")%
Example
%func.findAndReplace("#%ad.OU_DN_NAME%#","test","prod")%
Input value | Output value |
---|---|
If a user OU's, | DistinguishedName = "OU=IAM users,DC=test,DC=com".
"OU=IAM users,DC=prod,DC=com" |
The Encode URI macro works similar to the actual Javascript encodeURI component. By default, the API URL and parameters of webhook templates will be encoded before execution. Apart from these, if you want to encode any other values, use this option.
Syntax:
%func.encodeURIComponent("<value>")%
Example:
%func.encodeURIComponent("Ad secure pwd")%
Input value | Output value |
---|---|
L*urO@82# | L*urO%4082#%0A |
Note: You can also store the sensitive information in an environment variable and add that as a nested macro in the Encode URI macro.
The Decode URI macro works similar to the actual Javascript decodeURI component. If you want to decode the encoded attribute values fetched from the integrated application, then enter the value in the Decode URI Component field.
Input value | Output value |
---|---|
Ad%20secure%20pwd | Ad secure pwd |
This macro in the inbound webhook enables you to search and locate the desired pattern values from the configured endpoint's attribute columns. In the Retrieve Regex Match field (Select Macros > Utility), provide the column name and the pattern to search and match. Once done, click Add.
This way, when data is fetched from the endpoint, it will include only the string pattern required for API processing and discard the rest in the attribute value.
Note: The Retrieve Regex Matches macro can only be used in naming formats.
Attach
If you want to use two macros consecutively, use the :ATTACH: string in between them while fetching the data from the endpoints.
Syntax:
%<prefix>.<macroname>%:ATTACH:%<prefix>.<macroname>%
Example:
%ad.givenName%:ATTACH:%ad.department%
Input value | Output value |
---|---|
If the user's given name is test and the department name is accounts. | testaccount |