Skip to content

Latest commit

 

History

History
309 lines (238 loc) · 12.3 KB

user-convertexternaltointernalmemberuser.md

File metadata and controls

309 lines (238 loc) · 12.3 KB
title description author ms.reviewer ms.localizationpriority ms.subservice doc_type ms.date
user: convertExternalToInternalMemberUser
Convert an external user to an internal member.
yyuank
iamut
medium
entra-users
apiPageType
10/15/2024

user: convertExternalToInternalMemberUser

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Convert an externally authenticated user into an internal user. The user is able to sign into the host tenant as an internal user and access resources as a member. For more information about this conversion, see Convert external users to internal users.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

Important

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. User Administrator is the least privileged role supported for this operation.

HTTP request

POST /users/{usersId}/convertExternalToInternalMemberUser

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the parameters.

The following table lists the parameters that are required when you call this action.

Parameter Type Description
mail String Optional.
passwordProfile passwordProfile Required for users whose authentication is managed in the cloud.
userPrincipalName String Required for cloud users to change the userPrincipalName. Not required for on-premises synced users, as their userPrincipalName is managed on-premises.

Response

If successful, this method returns a 200 OK response code and conversionUserDetails response object.

Examples

Example 1: Convert a cloud user and require them to reset their password on next sign in

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/0b8cc234-ef87-4015-9785-cbb42000d41c/convertExternalToInternalMemberUser
Content-type: application/json

{
    "userPrincipalName": "[email protected]",
    "passwordProfile": {
        "password": "Zdi087#2jhkahf",
        "forceChangePasswordNextSignIn": "true"
    }
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.conversionUserDetails",
    "displayName": "Adele Vance",
    "userPrincipalName": "[email protected]",
    "convertedToInternalUserDateTime": "2024-02-05T20:16:37.5012924Z",
    "mail": "[email protected]"
}

Example 2: Convert a cloud user, change their mail address, and require password reset on next sign in

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/0b8cc234-ef87-4015-9785-cbb42000d41c/convertExternalToInternalMemberUser
Content-type: application/json

{
    "userPrincipalName": "[email protected]",
    "passwordProfile": {
        "password": "Zdi087#2jhkahf",
        "forceChangePasswordNextSignIn": "true"
    },
    "mail": "[email protected]"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.conversionUserDetails",
    "displayName": "Adele Vance",
    "userPrincipalName": "[email protected]",
    "convertedToInternalUserDateTime": "2024-02-05T20:16:37.5012924Z",
    "mail": "[email protected]"
}

Example 3: Convert external User to internal for a user synchronized from on-premises AD

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/0b8cc234-ef87-4015-9785-cbb42000d41c/convertExternalToInternalMemberUser

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.conversionUserDetails",
    "displayName": "Adele Vance",
    "userPrincipalName": "[email protected]",
    "convertedToInternalUserDateTime": "2024-02-05T20:16:37.5012924Z",
    "mail": "[email protected]"
}

Related content