0 votes

Hi,

I am running a report to dump some attributes. I have one attribute that is Yes or No in AD.

I want to transform that when generating that in a report.

<br>

AD value Report output value
Yes True
No False

How can do I this? I believe it is script in a report -specific column but not sure how to construct.

Thanks.

by (320 points)
0

Thanks, this accomplished what I needed.

A follow up question, how would I look up Disabled account and reference property to some similar transforms?

I thought of using adm-VirtualColumnDisabled but that is a caluculated value.

1 Answer

0 votes
by (270k points)

Hello,

Yes, you are right. It can only be done using a report-specific column. For details on working with columns, have a look at section Report-Specific Columns of the following tutorial: https://www.adaxes.com/tutorials_ActiveDirectoryManagement_CreateReport.htm#collapse3. In your case, the column should be of Text type and generated by the below script. In the script, the $propertyName variable specifies the LDAP name of the Boolean property (e.g. adm-CustomAttributeBoolean1) whose values will be displayed in the report column.

$propertyName = "adm-CustomAttributeBoolean1" # TODO: modify me

# Get property value
$object = $Context.GetADObject()
try
{
    $propertyValue = $object.Get($propertyName)
}
catch
{
    $columnValue = $NULL
}

# Set column value
if ($propertyValue -eq $False)
{
    $columnValue = "False"
}
elseif ($propertyValue -eq $True)
{
    $columnValue = "True"
}

$Context.Value = $columnValue

If your report is generated by a script, it is recommended to generate report-specific column values in the script itself. For details, have a look at section Setting values for custom columns of the following SDK article: http://adaxes.com/sdk/GeneratingReports/#setting-values-for-custom-columns.

Related questions

0 votes
1 answer

Hi, I copied report "recently created users" and added a parameter to check for specific value in extensionAttribute3. If this attributes starts with e.g. value "startdate" , only those users ... $null, * , %%, ? , ...) Any idea how to build the report?

asked Jul 7, 2023 by wintec01 (1.1k points)
+1 vote
1 answer

I see many questions regarding this in the Forum, and last solution is from 2014 - based on custom PS script, has something in the product come up that solves this ... outputs users that does not comply to property pattern in order to upkeep AD sanity. Thanks

asked Jan 21, 2021 by spinnetho (50 points)
0 votes
1 answer

Hi, I would like to add a CSV file during my group creation form and add users from CSV to new created group. However the CSV file is converted into Binary file and I am ... help is really appreciated. Thanks! PS: What I tried so far and error message I got

asked Jul 3, 2023 by wintec01 (1.1k points)
0 votes
1 answer

I had a script that would copy the values from adm-CustomAttributeTextMultiValue1 and save them into extensionAttribute15 as a comma seperated list. The script somehow got deleted and I can't seem to find the tutorial I used to create it before.

asked Jul 1, 2022 by jordan (110 points)
0 votes
0 answers

Hey Guys We have some issues with new meeting rooms that we have created. Previously we used to have on-premise exchange but switched to office365. Before doing ... OU but the interface are different. under exchange properties they are different aswell.

asked Sep 18, 2019 by seanr (70 points)
3,326 questions
3,026 answers
7,727 comments
544,683 users