Table of Contents
Use the Entra Admin Center or PowerShell to Convert to Internal User Accounts
Many Microsoft 365 tenants support a mixture of internal and external accounts. Internal accounts are member accounts that authenticate with the tenant. External accounts authenticate somewhere else, such as another Microsoft 365 tenant. The most common form of external accounts found in Microsoft 365 tenants are guest accounts created to participate in team or group memberships or for sharing. Other examples are the accounts synchronized into a tenant directory through membership of a Microsoft 365 multi-tenant organization (MTO).
The Convert to Internal User Feature (Preview)
A recent preview feature introduced by the Entra ID team allows organizations to convert accounts from external to internal. In effect, the code takes an external account identity, breaks the link to the original account, and makes the account local. The original account remains intact and is not removed, so some cleanup might be necessary to remove duplicates.
The Entra admin center includes an option in the user account overview to convert the account (Figure 1). The option is only available for external accounts.

Selecting the option displays a dialog to allow the administrator to specify the user principal name, password, and (optionally) email address for the converted account (Figure 2).

The conversion process preserves the account’s membership in Microsoft 365 groups and teams. However, some background synchronization must happen to make sure that all workloads recognize that the account is now internal. In most cases, signing out of all services should be enough (you can force this by revoking the account’s access token), but you might need to remove the Teams cache to force a rebuild of team rosters.
Convert to Internal User Accounts with PowerShell
Being able to convert an external account to internal through a portal is great for a one-off operation, such as when a contractor joins the organization as a permanent employee. It’s not so good when dealing with large-scale account changes like those that happen during corporate mergers and acquisitions. This is where the automation capabilities of PowerShell are invaluable.
The steps needed to convert an external account to internal with PowerShell are straightforward:
- Connect to the Microsoft Graph. My example uses an interactive Microsoft Graph PowerShell SDK session.
- Find the source account and check that it is an external identity. My test is that an account is external if the email address for the account doesn’t belong to any of the tenant’s registered domains.
- Figure out the new user principal name, email address, and a temporary password. Create a password profile to force the user to create a new password the next time they sign in.
- Call the convertExternalToInternalMemberUser API to make the change. The API is currently accessed through the beta endpoint. The new User-ConvertToInternal.ReadWrite.All Graph permission allows access to the API.
- If everything works, update the account’s Mail property and revoke the account’s access token.
Here’s the code that does most of the work:
$PasswordProfile = @{} $PasswordProfile.Add('password',$NewPassword) $PasswordProfile.Add('forceChangePasswordNextSignIn', $true) # Create the parameters to convert the account $NewAccountParameters = @{} $NewAccountParameters.Add('userPrincipalName', $NewUserPrincipalName) $NewAccountParameters.Add('passwordProfile', $PasswordProfile) Write-Host "Switching the account to be internal..." # Switch the account to make it internal $Uri = ("https://graph.microsoft.com/Beta/users/{0}/convertExternalToInternalMemberUser" -f $SourceUser.Id) $NewAccount = Invoke-MgGraphRequest -Uri $Uri -Body $NewAccountParameters -Method POST -ContentType "application/json" # If we get back some account details, check to make sure that they're what we expect If ($NewAccount) { $CheckNewAccount = Get-MgUser -UserId $SourceUser.Id -Property id, displayName, userPrincipalName, UserType If ($CheckNewAccount.usertype -eq 'Member' -and $CheckNewAccount.UserPrincipalName -eq $NewUserPrincipalName) { Update-MgUser -UserId $CheckNewAccount.Id -Mail $NewUserPrincipalName $RevokeStatus = Revoke-MgUserSignInSession -UserId $CheckNewAccount.Id Write-Host ("{0} is now a {1} account" -f $CheckNewAccount.UserPrincipalName, $CheckNewAccount.userType) Write-Host ("The temporary password for the account is {0}" -f $NewPassword) Write-Host ("Remember to assign some licenses to the converted account and to remove it from the previous source.") } }
You can download the full script from GitHub.
Some Cleanup Necessary
Being able to switch a user account from external to internal is a useful feature. Remember that some cleanup is necessary to make the newly switched account a full member of the organization. It’s important to assign licenses to the account after its conversion as otherwise the account won’t be able to access Microsoft 365 services. In addition, some adjustments might be necessary to ensure that the account properties are fully populated so that the Microsoft 365 profile card displays correct information and functionality like dynamic groups and dynamic administrative units pick up the new account as appropriate.
Learn more about how the Entra ID and the rest of the Microsoft 365 ecosystem really works on an ongoing basis by subscribing to the Office 365 for IT Pros eBook. Our monthly updates keep subscribers informed about what’s important across the Office 365 ecosystem.
what about the opposite? I want to convert an Internal account to an External account with PowerShell.
There isn’r an API for this purpose. But I suggest that moving an account from internal to external status will take a lot more involvement on the part of the tenant that will host the new external account. It’s not an action that you can take on your own.
That’s why I want to script it. I can manually do all of the tasks I need through the Entra ID Portal, but I really don’t want to do those tasks manually for 300 users. What I have is a tenant to tenant migration for M&A. We are already migrating the identities, mail, Teams, etc. That’s easy peasy. The problem is that the Source tenant has many apps that the users still sign into, and are configured through RBAC. What I found works is, 1) remove the E3 license of the user, 2) convert the Source account from Internal to External, where the External account is their migrated user account in the target tenant. 3) The user can then go back to their Applications in the old tenant, but are authenticated using their new migrated creds.
T2T migrations are not my speciality. I suspect that most people who go through the process use a commercially-sourced tool from an ISV. It must be possible to do this because the T2T vendors do it. I just haven’t worked out the necessary code.