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.


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)
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

by (307k points)
0 votes

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

I am trying to create a report that gets the Distribution Groups where Memebrs includes objects that match the initiator's email. For example, if the initiators email is ... I am not very good with the Adaxes specific scripts right now. Adaxes Version:

asked 8 hours ago by apruitt (280 points)
0 votes
1 answer

I am creating a custom report and I wonder. Is it possible to retain multiline formatting aka the data in a row column will not be shown as a one liner in the report custom column? Example: ... ,id | foreach {"id: $($_.id) name: $($_.name)"}) -join "`n"

asked 14 hours ago by KIT (980 points)
0 votes
1 answer

I am trying to find a way to get an hourly report on locked out user accounts to only be sent if the total amout of locked out account exceeds 10 users. Is this possible in ... a way to setup the logic to check to see how many items are returned in a report.

asked Jun 12, 2024 by Vertigo (50 points)
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 (2.4k points)
0 votes
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)
+1 vote
1 answer