Hi @Sai Prathap
Thank you for reaching Microsoft Q&A Forum!
I understand that you would like to know the expression for SelectUniqueValue() function which can enable creation on UPN.
You can use the SelectUniqueValue
function to generate unique values for the userPrincipalName (UPN) attribute. Here is an example expression that generates UPN values in the format of [firstname.lastname@contoso.com], [firstname.lastname1@contoso.com], [firstname.lastname2@contoso.com]:
SelectUniqueValue(
Join("@", NormalizeDiacritics(StripSpaces(Join(".", [PreferredFirstName], [PreferredLastName]))), "contoso.com"),
Join("@", NormalizeDiacritics(StripSpaces(Join(".", [PreferredFirstName], [PreferredLastName], "1"))), "contoso.com"),
Join("@", NormalizeDiacritics(StripSpaces(Join(".", [PreferredFirstName], [PreferredLastName], "2"))), "contoso.com")
)
This expression generates three unique UPN values for each user, with the format of [firstname.lastname@contoso.com], [firstname.lastname1@contoso.com], [firstname.lastname2@contoso.com]. If the first value already exists in the target directory, it will try the second value, and so on until it finds a unique value.
Reference: Generate unique value for userPrincipalName (UPN) attribute
Hope this helps. Do let us know if you any further queries by responding in the comments section.
Thanks,
Akhilesh.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.