How to use dates in reports, web query columns and filters
Summary: This article will explain how to use the Date\Time attributes in filters and columns in automation, reporting and web query rules.
Applies to: Cayosoft Administrator 6.3.1 or later.
Active Directory stores several attributes as Date/Time values, such as accountExpires, lastLogonTimestamp, and pwdLastSet. However, these values are stored as large integers, making them difficult to read and use in filters.
In Cayosoft Administrator, you can use a wrapper property, which converts these attributes into a more user-friendly Date/Time format. Instead of using the raw AD attribute, it is recommended to use the corresponding wrapper property, as described below.
| AD attribute | Wrapper policy |
|---|---|
| pwdLastSet | PasswordLastSet |
| accountExpires | AccountExpirationDate |
| whenCreated | CreationTimeStamp |
| whenChanged | ModifiedTimeStamp |
| lastLogonTimeStamp | LastLogonDate |
Filtering by dates
Example 1: Use the AD Users reporting rule to list all user accounts whose password was changed in the last 5 days.
We will use the PasswordLastSet attribute wrapper to get the date when the user's password was changed.
In the Cayosoft Administrator console, navigate to AD Users report rule.
Browse for the Other Query Settings section.
Add PasswordLastSet to the Properties to display setting.
-
In the Initialization Script, set this script:
Copy{$global:DatePeriod = (Get-Date).AddDays(-5)} In the Query Criteria, click ... and build the following query criteria:
(PasswordLastSet - Not equal - "Null")And(PasswordLastSet - Greater than or equal - $DatePeriod).Click Save Changes.
Example 2: Use the AD Users reporting rule to list all user accounts whose password was last changed before 09/01/2025.
Repeat steps 1-3 from Example 1.
-
In the Initialization Script, set this script:
Copy{$global:DatePeriod = (Get-Date 09/01/2025)} In the Query Criteria, specify this filter:
(PasswordLastSet - Not equal - "Null")And(PasswordLastSet - Less than - $DatePeriod)Click Save Changes.
Adding column with Date\Time property to the report output
Example: Use the AD Users reporting rule to list all user with the columns, displaying when user last changed his password and when account is set to expire.
In the Cayosoft Administrator console, navigate to the AD Users report rule.
Browse for the Other Query Settings section.
To display the Date\Time attribute as a report column, add the corresponding attribute wrappers
PasswordLastSetandAccountExpirationDateto Properties to display.-
Click Save Changes.
After that, the AD Users report will have the PasswordLastSet and the AccountExpirationDate columns.
Adding a column with Date\Time property to the web query grid view
Example: In the AD Users web query add columns, displaying when a user last changed his password and when an account is set to expire.
In the Cayosoft Administrator Console, navigate to Configuration > Web Portal > Virtual Admin Units.
Expand Active Directory > AD Users web query.
Browse for the More Options section.
To display the Date\Time attribute as a web query column, add the corresponding attribute wrappers
PasswordLastSetandAccountExpirationDateto Properties to display.-
Click Save Changes.
After that, the AD Users web query will have PasswordLastSet and AccountExpirationDate columns.
Comments
0 comments
Please sign in to leave a comment.