Hi,
I found the following example to remove special characters from an attribute but somehow I can't get it to work.
I'm using this script in a business rule before creating the user.
$props = @("email","sAMAccountName", "userPrincipalName")
$map =@{ "å"="a"; "ö"="o"; "ä"="a";"ü"="u"; "ñ"="n"; "é"="e"; "-"=""; "'"="" }
foreach ($prop in $props)
{
if ($Context.IsPropertyModified($prop))
{
$value = $Context.GetModifiedPropertyValue($prop)
foreach ($key in $map.Keys)
{
$value = $value.Replace($key, $map[$key])
}
$Context.SetModifiedPropertyValue($prop, $value)
$Context.LogMessage($prop + ": " + $value, "Information")
}
}
Can someone identify what i'm doing wrong?
Incorrect if statement?