Is it possible to change a users UPN in an Azure B2C tenant via powershell?
Is it possible to change a users UPN in an Azure B2C tenant via powershell?
Hi @SebastianGedge-9923 , have you used any articles or documents and are getting stuck? This article here does a good job explaining how to do this. It worked the last time I used it. Please let me know if this works for you. If not I can help you further.
Best,
James
Hi Hames,
I have followed similar articles and the first part of method 1 works and i can change the UPN to he .onmicrosoft address but am faced with the following when trying to change the UPN to a @gmail address in the second command.
"set-AzureADUser : Error occurred while executing SetUser
Code: Request_BadRequest
Message: The domain portion of the userPrincipalName property is invalid. You must use one of the verified domain
names in your organization.
RequestId: 160e3284-933b-4803-a9c9-b7a3792219a2
DateTimeStamp: Tue, 21 Sep 2021 06:35:37 GMT
Details: PropertyName - userPrincipalName, PropertyErrorCode - InvalidValue
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At line:1 char:1
+ set-AzureADUser -ObjectId -UserPrincipalName *@gmail.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-AzureADUser], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.SetUser
7 people are following this question.