I need help converting a few commands from msoluser to mguser, to change the immutableid #2951
Unanswered
NoSubstitute
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I ran your line of code in our tenant without any issues.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our setup we have a SAML with Google Workspace provisioning users to M365.
When a user is renamed, for various reasons, and their email changes in Workspace, it pushes this new address to the account in EntraID, but it doesn't change the ImmutableId, making login to something like Sharepoint fail, because it expects the UPN and the ImmutableId to be the same (or whatever, I just know it fails because the ImmutableId is wrong - it still has the old address).
This worked with msoluser, but with MS Graph and mguser, the commands and options I have do not work, so I need help fiding alternative options to accomplish the same thing.
Here are the commands. edu.lomma.se is one of our tenants.
Get-MsolUser -All -DomainName edu.lomma.se | where { $_.UserPrincipalName -ne $_.ImmutableId } | Select DisplayName,UserPrincipalName,ImmutableId
Set-MsolUserPrincipalName -UserPrincipalName [email protected] -NewUserPrincipalName [email protected]
Set-MsolUser -UserPrincipalName [email protected] -ImmutableId "[email protected]"
Set-MsolUserPrincipalName -UserPrincipalName [email protected] -NewUserPrincipalName [email protected]
I've tried to figure this out by myself, but it's just too hard.
I've only managed to list all users with edu.lomma.se.
Get-MgUser -All | where UserPrincipalName -like "*@edu.lomma.se"
I have not at all been able to list users with the ImmutableId value, whiich of course is necessary for the comparison part of the command. I tried adding it with -Property, but nothing shows.
Get-MgUser -All -Property DisplayName,UserPrincipalName,OnPremisesImmutableId | where UserPrincipalName -like "*@edu.lomma.se"
Beta Was this translation helpful? Give feedback.
All reactions