0 votes

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.

by (110 points)
0

Hello Jordan,

For us to provide you with the script, please, specify what should be done in case when adm-CustomAttributeTextMultiValue1 is empty. Should extensionAttribute15 also be cleared?

0

Yes, that would be preferable.

Thanks!

1 Answer

+1 vote
by (272k points)
selected by
Best answer

Hello Jordan,

Thank you for the confirmation. Please, find the script below. In the script:

  • $propertyStoringValuesName - Specifies the LDAP name of the multi-valued property to take values from.
  • $propertyToUpdateName - Specifies the LDAP name of the property to save values to.
$propertyStoringValuesName = "adm-CustomAttributeTextMultiValue1" # TODO: modify me
$propertyToUpdateName = "extensionAttribute15" # TODO: modify me

# Get property values
try
{
    $values = $Context.TargetObject.GetEx($propertyStoringValuesName)
}
catch
{
    $Context.LogMessage("Property $propertyStoringValuesName is empty. Property $propertyToUpdateName will be cleared", "Warning")
    $Context.TargetObject.Put($propertyToUpdateName, $NULL)
    $Context.TargetObject.SetInfo()
    return
}
$valuesToSet = [system.String]::Join(",", $values)

# Update the user
$Context.TargetObject.Put($propertyToUpdateName, $valuesToSet)
$Context.TargetObject.SetInfo()
0

Perfect! Thanks!

Related questions

0 votes
0 answers

I am trying to find a way to create Groups based off an OU and a list of options (check boxes) within the portal For example: Select the Target OU to add groups ... 3 - Remote Administrators Option 3 - Remote Developers Option 4 - Readers Option 4 - Writers

asked Sep 11, 2020 by dknapp (100 points)
0 votes
1 answer

My security team is looking to do a security review and would like the vendor to fill out a questionnaire.

asked Aug 25, 2023 by LarrySargent (20 points)
0 votes
1 answer

Hi All, We are looking at using Adaxes however would like to be able to see the Adaxes logs within McAfee SIEM. Has anyone tried and tested this and could give any ... monitoring. Does Adaxes have a preferred route to get logs to the SIEM? Many Thanks!

asked Apr 8, 2020 by antondubek (440 points)
0 votes
1 answer

I have a dropdown-field on the web surface, which is populated by a script. The script looks up all groups in a specific OU and displays them. In the Property Pattern ... random order. What should i do to show the groups in alphabetical order in the portal?

asked Sep 15, 2020 by lohnag (160 points)
0 votes
1 answer

I'm in the process of creating a Web interface for requesting IT accounts. Upon submission, I want to run a Powershell script that will create an item in a Sharepoint task list.

asked May 14, 2021 by sandramnc (870 points)
3,346 questions
3,047 answers
7,777 comments
544,979 users