0 votes

Hello,

is it possible to put the first letter of the name in uppercase:
example: Marc

thx

by (360 points)
0

Hello,

Yes, this is possible. When would you like to check the user's name: before creation, after creation, may be after modification or on a scheduled basis? Could you provide some more detail on what you are trying to achieve?

0

i will like check the user's name before creation with user pattern.

1 Answer

0 votes
by (216k points)

This cannot be done with Property Patterns, but you can use a Business Rule for this purpose. You can create a Business Rule that will be launched before creating a user and that will always set the first letter of the user's name in upper case. See the Validate/Modify User Input Using a Script Tutorial for instructions on how to create such a Business Rule. On the 5th step of the tutorial, you need to paste the following script:

$firstName = "%givenName%"
$firstName = "%givenName:upper,1%" + $firstName.Substring(1)
$Context.SetModifiedPropertyValue("givenName", $firstName)

If you would also like to set the first letter of the user's surname in uppercase, add the following lines to the end of the script:

$lastName = "%sn%"
$lastName = "%sn:upper,1%" + $lastName.Substring(1)
$Context.SetModifiedPropertyValue("sn", $lastName)
0

I tried your script I am receiving an exception calling "SetModifiedPropertyValue" with"2" arguments: property can't be modified in this context because no action is available

0

Hello,

The scripts will work only in a Business Rules triggered before creating or updating a user. They won't work in Custom Commands or Scheduled Tasks. If you want to use them in commands or tasks, you'll need slightly different versions of the scripts.

First Name:

$firstName = "%givenName%"
$firstName = "%givenName:upper,1%" + $firstName.Substring(1)
if ($firstName -cne "%givenName%")
{
    $Context.TargetObject.Put("givenName", $firstName)
    $Context.TargetObject.SetInfoEx(@("givenName"))
}

Last Name

$lastName = "%sn%"
$lastName = "%sn:upper,1%" + $lastName.Substring(1)
if ($lastName -cne "%sn%")
{
    $Context.TargetObject.Put("sn", $lastName)
    $Context.TargetObject.SetInfoEx(@("sn"))
}
0

Hello, this works very well for me, but, if there are two surnames, how do I capitalize them both?

Example: Vincent Van Gogh

0

Related questions

0 votes
1 answer

Is it possible to retrieve the first letter of first names (double name). example: Jean-Francois -> jf thx

asked Dec 12, 2011 by mmichard (360 points)
0 votes
1 answer

Having a strange issue, when executing a powershell command in adaxes as a business rule, the first line, no matter what is there comes up as invalid. Originally my ... line, but I've tried everything and universally the first line is flagged as invalid

asked Oct 23 by curtisa (290 points)
0 votes
1 answer

Hi there, Adaxes looks great. It needs a bit of time to investigate all the features. I wonder how to upper lastname in a property pattern, to enforce strict naming convention. Any clue ? Thanks in advance

asked Mar 17, 2011 by sroux (800 points)
0 votes
1 answer

Here are the actrions of the custom command. Here are the parameters. Need a script to copy the param user's file path for home drive example: Param user's home drive ... ) should be //server1/homedirs/%username%. Then give the user full control of the folder.

asked Feb 8, 2023 by mightycabal (1.0k points)
0 votes
1 answer

Hello The danish/norwegian letter "Ø" is not handled correctly in Adaxes. Even if regexp is set to ^[A-Z] , it's still possible for the user to enter and use the letter "Ø" in their ... : - "Ø" = U+00d8 (upper case) - "ø" = U+00f8 (lower case) - Thanks

asked May 11, 2016 by Boxx.dk (2.6k points)
3,548 questions
3,239 answers
8,232 comments
547,814 users