0 votes

I want to add a custom column in a report that displays members of a group that shows the age of the user account in days. Is that possible?

by (470 points)

1 Answer

0 votes
by (289k points)

Hello,

Yes, it is possible. You will need to generate the custom column value using a script. In the script, use the New-TimeSpan cmdlet. The following article will also be helpful: https://adaxes.com/sdk/GenerateReportCustomColumns.

0

Thank you.

This is what I have but it throws an error. Can you let me know how to adjust it to return the value in days?

# Assign a column value to $Context.Value
$Context.Value = New-TimeSpan -End (Get-Date %whenCreated%)
0

Hello,

The script is expected to error out because it is not allowed to execute the New-TimeSpan cmdlet with only the -End parameter. That is something you can see from the article we referenced in the previous post. Also, value reference %whenCreated% will not work here as it will resolve into the property value of the initiator making the column value the same for all objects in the report. Here is the script you can use.

# Get object creation date
$object = $Context.GetDirectoryObject()
$whenCreated = $object.Get("whenCreated")

$timeSpan = New-TimeSpan -Start $whenCreated -End "%datetime%"
$Context.Value = $timeSpan.Days
0

thank you

Related questions

0 votes
1 answer

We have four OUs in Active Directory (Pending Deletion, Disabled with Mail Delegates, Disabled with HR Extensions and Disabled_Temp_Leave) that users are moved to prior to their eventual ... past 7 days have been moved to one of 4 of these OUs. Thanks!

asked Jun 3, 2021 by RayBilyk (240 points)
0 votes
1 answer

Adaxes version is 2018.2. I have build a custom report, and I don't want the 'Name' column with the pictures to appear in it. But it seem to be mandatory, it is greyed ... . Is there a way to remove / hide / or change the mandatory attribute or column ? Thanks

asked Jan 9, 2020 by Isabelle (50 points)
0 votes
1 answer

It would be good to have a selectable column for the tasks schedule pane. This would allow us to easily show tasks scheduled dates and give us the ability to sort by the ... case it would be good to sort all of these password resets by their scheduled date.

asked Apr 30 by Moodie007 (60 points)
0 votes
0 answers

It would be great if we could run a report on an OU and get the following information: Computer Name Local Accounts Whether or not the account is an administrator ... this is less important. Thanks in advance. Your support team is great and appreciated.

asked Sep 8, 2021 by mikek (80 points)
0 votes
1 answer

Is there any way to add a warning message when someone tries to add a group member that already is member? Checked config but found nothing related. Added a new member that ... the group and there is no warning, and the logs show that the task was completed.

asked Jul 9 by lramirez (20 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users