Replace Accent Characters

i need to replace the characters below in the First Name, Last Name, & username fields before the account is created. for the username i know i can add those characters to the restricted characters list....however this does not replace the characters it just removes the characters from the username. I would like to have the characters replaced with the ASCII equivalents.  what would be the best way to do this? I have attempted to use a workflow but that hasn't worked well so far. If i can't replace the characters i would like to present an error message to the user when they try to add a name with those characters in them. 

ÀàÁáÂâÃãÄäÇçÈèÉéÊêËëÌìÍíÎîÏïÑñÒòÓóÔôÕõÖöŠšÚùÛúÜûÙüÝýŸÿŽž

ASCII mapping below. 

https://docs.oracle.com/cd/E29584_01/webhelp/mdex_basicDev/src/rbdv_chars_mapping.html

Parents
  • Here's an article on cleaning accents from strings:

    lazywinadmin.com/.../powershell-remove-diacritics-accents.html

    I setup something to deal with this as follows:

    Create a change workflow to detect a user create.

    Create a script activity that traps and modifies properties you want to fix and place that script active BEFORE the user create in the workflow.

    Sample script activity:

    # Top of script acitivity

    Function RemoveAccents ($AccentedString)

    {

    # Insert cleaning code here

    # Return the clean string

    $CleanedString

    }

    Function CatchAccents ($Request){

    # Catch the accent in the samaccountname

    $NewUserSam = $Request.get("samaccountname")

    $CleanNewUserSam = RemoveAccents $NewUserSam

    # Replace the inbound samaccountname with the cleaned one

    $Request.put("sanaccountname", $CleanNewUserSam)

    $NewUserName = $Request.get("Name")

    $CleanNewUserName = RemoveAccents $NewUserName

    # Replace the inbound user name with the cleaned one

    $Request.put("name", $CleanNewUserName)

    # ...and so on

    } # End of CatchAccents Function

    # End of script activity

  • the $request.put("samaccountname", cleannewusersam) line is failing with the error message below.

    Exception calling "Put" with "2" argument(s): "Object reference not set to an instance of an object."

    i am trying to figure out what the name of the attribute would be in the $request. 

    DEBUG: 20+ >>>> $Request.put("sAMAccountName", $CleanNewUserSam)

    Call method '$Request.Put'
    Arguments list:
    [1] : Value=sAMAccountName : Type=System.String
    [2] : Value=System.Object[] : Type=System.Object[] : IsMultivalued=True : Count=1
    [0] : Value=flastaauyyiinnxyz : Type=System.String
    [1] : Value=

    ERROR:
    At line: 20 char:9. Exception calling "Put" with "2" argument(s): "Object reference not set to an instance of an object."

Reply Children
No Data