Rule description
This rule queries the specified Active Directory scope and for each returned user sets or clears the specified Active Directory attribute.
When to use this rule
Use this rule when you need:
-
To update an attribute for a set of users.
- To clear one or several attributes at once for a set of users.
-
To set attribute value during new users' creation. For details, see the How to configure one rule to run after another rule or a web action article.
Rule Settings
Query Section
Setting name | Description |
---|---|
Limit scope to this domain or OU
|
This setting defines the search query scope. To improve query performance, limit the scope to specific OU.
Important: To test rule configuration, limit the rule scope to an OU that contains test accounts or objects.
|
Query criteria |
Query criteria are sent with the query and may improve query performance.
Tip: For different samples on the criteria builder, see KB20180410-1.
|
More options | |
Filter |
To hide unwanted data based on criteria set the filtering conditions here.
Tip: For optimal performance, use Query criteria above to filter objects whenever possible.
|
Returned properties
|
To display additional properties for each object found by the query, add those properties to the list.
|
Sort by | Sort result objects list. |
Initialization Script | |
Script |
Usually, rules use query criteria to limit the query search scope. It improves the performance of the executed rule. Due to PowerShell limitations, it is not possible to use calculated expressions in query criteria. That is the point where the initialization script can help. You can initialize a global variable in this setting and then use it in query criteria.
Important: To use a variable, declared in the initialization script, in the query scope, it must be global: $global:<variable name>.
Example: Update AD users, created in the last ten days.
{$global:DatePeriod = (Get-Date).AddDays(-10)}
|
Action Section
Setting name | Description |
---|---|
Attribute(s)
|
Select an attribute from the list. You can select multiple attributes. In this case, all these attributes would be cleared or set to the value specified in the Value setting. |
Value
|
Set attribute(s) value. Example 1: Append some text to AD Users DisplayName attribute. $($FoundObject.DisplayName + "teststring") Note: You must add DisplayName attribute to Returned properties list. Example 2: Change all phone numbers from this format 111.222.3333 to this format 111-222-3333. {[String]::Format('{0:###-###-####}',[Int64]($FoundObject.telephoneNumber -replace '\D+(\d+)','$1'))} Note: You must add telephoneNumber attribute to Returned properties list. Example 3: Disable Active Directory user:$($FoundObject.userAccountControl -bor 0x2) Note: You must add userAccountControl attribute to Returned properties list. Example 4: Set accountExpires attribute to expire in 90 days from now. ([DateTime]::Now.Date.AddDays(90)) Example 5: Update multi-valued virtual attribute. ["val1","val2","val3"] |
Update method*: |
Select the update method for the attributes value:
|
Simplified output*: |
When set to Yes, the output displays the user attribute values as they were initially queried, providing faster performance. When set to No, the system re-queries and verifies the values after the update, ensuring the output reflects the true final values. Choosing No may slow performance when handling large datasets due to the additional verification step. |
Account |
|
First name | Specify the user’s given name (first name). |
Initials | Set or update the user’s middle initials. |
Last name | Specify the user’s surname (last name). |
Display name | The full name as displayed in directory services. |
Description | Provide a field for entering an optional description for the account. |
Settings
|
|
Must change password at next logon | Determines if the user must change their password upon their next sign-in. |
Account enabled | Specifies whether the account is active and can be used. |
Password is not required | Indicates if a password is needed for the account. |
User cannot change password | Prevents the user from changing their password. |
Password never expires | Ensures that the password remains valid indefinitely without expiration. |
Smart card is required | Requires the user to sign in using a smart card. |
Account expiration date | Specify a date when the account will expire and become disabled. |
Do not require Kerberos preauthentication | Enables the user to skip Kerberos preauthentication. |
Organization | |
Office | Update or set the office location of the user. |
Job title | Update or set the user's job title. |
Department | Update or set the department where the user works. |
Company | Update or set the name of the company the user works for. |
Employee number | Update or set the user's employee number. |
EmployeeID | Update or set the user's employee ID. |
Division | Update or set the division of the company the user is part of. |
Manager | UUpdate or set the user's manager. |
Contact info | |
Country | Update or set the user's country. |
Office phone | Update or set the user's office phone number. |
Mobile phone | Update or set the user's mobile phone number. |
Street address | Update or set the user's street address. |
City | Update or set the user's city. |
State | Update or set the user's state or region. |
Postal code | Update or set the user's postal code. |
Other properties | |
Select columns from the source data and matched attribute | Select additional properties based on the source data and corresponding matched attributes. |
Other properties script | Allows configuring advanced property matches using a script. |
Output Section
This section defines the output format of this rule.
To get more information about this section, please see the Output section article.
Enforce/Schedule section
This section defines the schedule for how often to run the rule.
To get more information about this section, please see the Enforce/Schedule section article.
Change History
Version | Notes |
---|---|
11.3.1 | The Action section has been updated. |
7.3.1 | The Initialization Script section has been added. |
5.4.0 | The rule can be linked to web actions in Rules to run after this rule section. |
Comments
0 comments
Please sign in to leave a comment.