You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi rich,
thanks again for this very helpful PAW concept, i hope you are doing well in the difficult times at the moment.
There is a requirement to change the username (cn) from "first name surname" to "surname, first name".
Unfortunately the script has a problem with the comma in between. Can you help adapt the script so that it works correctly both with and without a comma?
Thanks for your help and time.
The text was updated successfully, but these errors were encountered:
Hi Rich, i hope you are doing well.
i have to correct myself, it is possible to differentiate between users with no commas in their name, herewith:
if($user.name -match ','){
# a comma was found in the Name attribute value
$dn = $user.distinguishedname
$department = ($dn -split '[,\=]')[4]
$locale = ($dn -split '[,\=]')[6]
}
else {
# no comma was found in the Name attribute value
$dn = $user.distinguishedname
$department = ($dn -split '[,\=]')[3]
$locale = ($dn -split '[,\=]')[5]
}
hi rich,
thanks again for this very helpful PAW concept, i hope you are doing well in the difficult times at the moment.
There is a requirement to change the username (cn) from "first name surname" to "surname, first name".
Unfortunately the script has a problem with the comma in between. Can you help adapt the script so that it works correctly both with and without a comma?
Thanks for your help and time.
The text was updated successfully, but these errors were encountered: