Why am I getting 404 in crossTenantIdentitySyncPolicyPartner even when I have permissions and cross-tenant exists?

Gurkirat Singh 40 Reputation points
2025-05-04T13:26:11.27+00:00

When I am trying to execute the following request

Invoke-RestMethod -Method Get -Headers @{Authorization = "Bearer $MSGraphToken"} -Uri "https://graph.microsoft.com/v1.0/policies/crossTenantAccessPolicy/partners/[REDACTED]/identitySynchronization"

It is giving me HTTP 404 Not Found error with following JSON body

{
  "error": {
    "code": "Directory_ObjectNotFound",
    "message": "Unable to read the company information from the directory.",
    "innerError": {
      "date": "2025-05-04T13:10:29",
      "request-id": "fe575774-3703-47b7-bb90-37f7fdd4c61d",
      "client-request-id": "fe575774-3703-47b7-bb90-37f7fdd4c61d"
    }
  }
}

It is given that partner tenant records exists in Get-MgPolicyCrossTenantAccessPolicyPartner cmdlet output and the requesting application token has Policy.Read.All permission.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,563 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Moosa Khan 175 Reputation points Microsoft External Staff Moderator
    2025-05-05T22:43:01.63+00:00

    Hello Gurkirat Singh,

    The error message you're encountering:

    "code": "Directory_ObjectNotFound",
    "message": "Unable to read the company information from the directory."
    , indicates that the specified partner tenant ID does not have an existing cross-tenant identity synchronization policy. This situation can arise due to several reasons, even if the cross-tenant relationship exists and you have the necessary permissions.
     

    Check API Permissions: Ensure that your application has the required Microsoft Graph API permissions, such as Policy.ReadWrite.CrossTenantAccess.
    Grant Admin Consent: If your application requires admin consent for these permissions, ensure that consent has been granted. Ensure that the tenant ID used in your requests is correct.
     

    Microsoft Document-:
    Configure cross-tenant synchronization using PowerShell or Microsoft Graph API - Microsoft Entra ID | Microsoft Learn 
    Github Document : https://github.com/MicrosoftDocs/entra-docs/blob/main/docs/identity/multi-tenant-organizations/cross-tenant-synchronization-configure-graph.md?utm_source=chatgpt.com#symptom---directory_objectnotfound-error

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.