0 votes

To avoid typos at the user creation, I want if it is possible to define der Property "IP Phone" by default as the last 4 digits of the property "Telephone Number" ?

Thanks

by (470 points)

1 Answer

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

Hello Boris,

First of all, you need to remove the IP Phone property from Web interface forms. For details, see https://www.adaxes.com/tutorials_WebInterfaceCustomization_CustomizeFormsForUserCreationAndEditing.htm.

As for updating the property, it can be done using a business rule triggering After creating/updating a user and the below PowerShell script. In the script:

  • $propertyToSet – Specifies the LDAP name of the property to update.
  • $sourcePropertyName – Specifies the LDAP name of the property whose characters will be used for the update.
  • $numbreOfLastCharacters – Specifies the number of last characters to extract.
$propertyToSet = "ipPhone" # TODO: modify me
$sourcePropertyName = "description" # TODO: modify me
$numbreOfLastCharacters = 4 # TODO: modify me

# Get last cahracters
try
{
    $sourcePropertyValue = $Context.TargetObject.Get($sourcePropertyName)
}
catch
{
    $Context.LogMessage("Property $sourcePropertyName is not specified.", "Warning")
    return
}

$charactersToSet = $sourcePropertyValue.SubString($sourcePropertyValue.Length - $numbreOfLastCharacters)

# Update the user
$Context.TargetObject.Put($propertyToSet, $charactersToSet)
$Context.TargetObject.SetInfo()

Related questions

0 votes
1 answer

The checkbox is not selected (False) by default.

asked May 30, 2022 by john.harding (70 points)
0 votes
1 answer

If the user name submitted is "jhon doe" all of the users properties will be lower case. We want it to force it to be "Jhon Doe" even if it was submitted in lower case.

asked Aug 31, 2022 by raul.ramirez (210 points)
0 votes
1 answer

Dear Support Admin Hi, I hope you are in good health. I have a problem regarding the office 365 license my problem is: I have a case where if HR adds a new AD user, ... Is that possible to do? for example using a script or display it in another form? Thank you

asked Mar 4, 2022 by systech (100 points)
0 votes
1 answer

I was able to get this to work using the information provided. Thank you. I have an additional question. After generating the sequential property values for the employeeNumber, is there a way to verify/check the last number used in Adaxes?

asked Dec 29, 2023 by cewilson (140 points)
0 votes
1 answer

We are replacing our Namescape rDirectory product with Adaxes because of the very flexible automation components. I've been able to replicate some of the pages previously ... vast majority of our users, that would function as the default company directory.

asked Aug 5, 2022 by MRBruce (110 points)
3,348 questions
3,049 answers
7,791 comments
545,050 users