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 (294k 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

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 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 (1.5k 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
0 answers

We currently convert user mailboxes to shared mailboxes during deprovisioning process but if the user mailbox was already a shared mailbox then the script throws an error ... user mailbox. Here is the actions of the current deprovision command: Thanks!

asked Oct 1 by Carlos (40 points)
0 votes
1 answer

As we use the dateformat dd.mm.yyyy I set it as required in this format in the regesp. Is it possible to convert the CustomAttributeText5 from "dd.mm.yyyy" in "yyyy ... [datetime]::ParseExact($entryDatePropertyName, "dd.MM.yyyy", $null).ToString("yyyy-MM-dd")

asked Jun 11 by fabian.p (380 points)
3,589 questions
3,278 answers
8,303 comments
548,140 users