Skip to main content
Graduate Track

Configuring Entra ID Cross-Tenant Access for B2B Guests

A hands-on runbook for junior engineers locking down Entra ID cross-tenant access, inbound MFA trust and Conditional Access before B2B guest onboarding.

Configuring Entra ID Cross-Tenant Access for B2B Guests
KBY Technologies17 min readIntermediate60 min

In this lesson

Share

Before you begin

  • Entra ID fundamentals
  • Conditional Access policy authoring
  • Microsoft Graph PowerShell basics

Track this tutorial

Choose your current status and tick each safety check as you complete it. Sign in to sync progress between devices.

Current status

Before you apply the change

Confirm these production-safety controls during the tutorial.

0 of 6 safety checks completed

#Operational requirement

You will get this ticket in your first month: “Partner company X needs access to a SharePoint site and two Teams channels by Friday.” Someone senior will tell you to “just invite them as guests.” Do not just invite them as guests. Entra ID ships with defaults optimised for adoption, not for your audit committee. Left untouched, the default cross-tenant access settings allow inbound and outbound B2B collaboration with every other Microsoft Entra organisation, and Microsoft documents the default guest invite setting (allowInvitesFrom) as everyone in every cloud except US Government, meaning anyone in the organisation, including existing guests, can invite guests. Inbound trust is the opposite: by default your tenant does not accept MFA, compliant-device or hybrid-joined-device claims from a partner’s home tenant, so a partner’s MFA performed in their own tenant is not trusted by yours unless you say so explicitly. The production consequence is not hypothetical: guests either hit unexpected MFA registration prompts from your Conditional Access policies mid-collaboration, or, where no Conditional Access policy targets guests at all, they sail through with no MFA requirement, and nobody in a security review can explain why an external identity has standing access to a finance SharePoint site with no MFA enforcement trail.

B2B sprawl is one of the fastest-growing sources of audit findings in Microsoft 365 tenants, which is why this task lands on junior identity engineers so often. Your job is to configure cross-tenant access settings deliberately: restrict who can invite guests, define inbound trust explicitly for the specific partner tenant, and back it with a Conditional Access policy that does not silently fail. This procedure assumes you already hold Global Administrator or Security Administrator rights, or at minimum the Microsoft Graph API permission Policy.ReadWrite.CrossTenantAccess, and that you are working in a tenant with Entra ID P1 licensing at minimum, since cross-tenant access policy and Conditional Access both require it. Confirm your assignment before you start; do not attempt this under a role that only has read access and hope it works.

#Implementation steps

Capture the current state before you touch anything. This is your rollback point, and you will need it if something breaks mid-onboarding.

1Connect-MgGraph -Scopes "Policy.Read.All","Policy.ReadWrite.CrossTenantAccess","Policy.ReadWrite.Authorization","Organization.Read.All"
2
3Get-MgPolicyCrossTenantAccessPolicyDefault | ConvertTo-Json -Depth 10 | Out-File .\ca-default-backup.json
4
5Get-MgPolicyCrossTenantAccessPolicyPartner -All | ConvertTo-Json -Depth 10 | Out-File .\ca-partners-backup.json
6
7Get-MgPolicyAuthorizationPolicy | Select-Object AllowInvitesFrom | ConvertTo-Json | Out-File .\guest-invite-backup.json

Next, tighten the tenant-wide external collaboration settings so guest invitations are not open to every user in the tenant. In the Entra admin centre, go to Identity > External Identities > External collaboration settings and set Guest invite restrictions to “Only users assigned to specific admin roles can invite guest users.” If your organisation genuinely needs broader invite rights, assign a role such as Guest Inviter to specific staff rather than leaving invitations open to everyone. This single setting stops the ad hoc guest sprawl that makes access reviews unmanageable six months later. It is also a tenant-wide change: members who currently invite partners themselves, including through Teams and SharePoint sharing, lose that ability the moment you save it. Record the current value (captured in the backup above), confirm with service owners which teams rely on member invites, and assign Guest Inviter to anyone who must keep inviting. Schedule the change for an agreed date in the change record, tell the people who currently invite guests what changes and whom to ask instead before that date, get it approved, and only then apply it.

Now configure the default cross-tenant access policy. This governs collaboration with tenants you have not explicitly configured, and it should be restrictive by default, not permissive. Blocking inbound B2B collaboration here applies tenant-wide: guests from every organisation without its own partner configuration lose access. Prepare the payload now but apply it last. First identify which organisations your existing guests come from (sign-in logs record each guest’s home tenant ID), create partner configurations for every one that must keep access, including the partner you are onboarding, and get the inventory and the block approved in the change record.

1$defaultParams = @{
2  b2bCollaborationInbound = @{
3    usersAndGroups = @{
4      accessType = "blocked"
5      targets = @(@{ target = "AllUsers"; targetType = "user" })
6    }
7    applications = @{
8      accessType = "blocked"
9      targets = @(@{ target = "AllApplications"; targetType = "application" })
10    }
11  }
12  inboundTrust = @{
13    isMfaAccepted = $false
14    isCompliantDeviceAccepted = $false
15    isHybridAzureADJoinedDeviceAccepted = $false
16  }
17}
18# Do not apply yet: run Update-MgPolicyCrossTenantAccessPolicyDefault only after the partner configurations exist

Create an explicit partner configuration for the tenant you are onboarding, and repeat it for each existing partner from your inventory. Get the partner’s tenant ID directly from them, not from a domain lookup; domain-to-tenant mapping is unreliable for multi-domain organisations and you will guess wrong at least once in your career if you rely on it.

Entra ID cross-tenant access configuration
1$partnerTenantId = "b1c14d5c-3a2e-4a91-9f6d-2c7e8a1d55f0"
2
3New-MgPolicyCrossTenantAccessPolicyPartner -BodyParameter @{
4  tenantId = $partnerTenantId
5  b2bCollaborationInbound = @{
6    usersAndGroups = @{
7      accessType = "allowed"
8      targets = @(@{ target = "AllUsers"; targetType = "user" })
9    }
10  }
11  b2bCollaborationOutbound = @{
12    usersAndGroups = @{
13      accessType = "allowed"
14      targets = @(@{ target = "AllUsers"; targetType = "user" })
15    }
16  }
17  inboundTrust = @{
18    isMfaAccepted = $true
19    isCompliantDeviceAccepted = $true
20    isHybridAzureADJoinedDeviceAccepted = $false
21  }
22}

Setting isMfaAccepted = $true is the step people forget, and it is the one that actually matters. Without it, your tenant does not accept the MFA the partner tenant already performed, so any guest caught by your Conditional Access MFA policy must complete MFA again in your tenant, registering a method with you first if they have none there. They are not blocked by default, but the second prompt and the unexpected registration step generate support calls and confuse partners.

Only once every required partner configuration exists, the sign-in inventory has been reviewed and the change is approved, apply the restrictive default, then check sign-in logs for blocked B2B sign-ins from tenants you missed:

1Update-MgPolicyCrossTenantAccessPolicyDefault -BodyParameter $defaultParams

Finally, back this with an explicit Conditional Access policy scoped to guest and external users, rather than relying solely on cross-tenant trust to carry the whole control. In the Entra admin centre, go to Protection > Conditional Access > New policy, set Users to include the “Guest or External User” types (specifically “B2B collaboration guest users” and “B2B collaboration member users”) and, for the pilot, limit the external tenants to the partner’s tenant ID, target the Office 365 app group (the documented value Office365 in Graph), which covers SharePoint Online and Teams (Microsoft recommends the group over individual apps because Teams depends on SharePoint and Exchange), and require MFA as a grant control. Deploy it in report-only mode first, always.

1New-MgIdentityConditionalAccessPolicy -BodyParameter @{
2  displayName = "CA-Guests-RequireMFA-PilotPartner"
3  state = "enabledForReportingButNotEnforced"
4  conditions = @{
5    users = @{
6      includeGuestsOrExternalUsers = @{
7        guestOrExternalUserTypes = "b2bCollaborationGuest,b2bCollaborationMember"
8        externalTenants = @{
9          "@odata.type" = "#microsoft.graph.conditionalAccessEnumeratedExternalTenants"
10          membershipKind = "enumerated"
11          members = @($partnerTenantId)
12        }
13      }
14    }
15    applications = @{ includeApplications = @("Office365") }
16  }
17  grantControls = @{
18    operator = "OR"
19    builtInControls = @("mfa")
20  }
21}

Run it in report-only for at least five business days, and do not flip state to enabled until the report-only results described under Verification are clean for a full pilot user cycle and the change is approved. Widening it to all external tenants later is a separate, tenant-wide change that needs its own report-only run and approval. That window is your safety margin against blocking a partner mid-project because of a misconfigured claim you did not catch in testing.

#Verification

Confirm the partner-specific policy landed correctly before you tell anyone the work is done:

1Get-MgPolicyCrossTenantAccessPolicyPartner -CrossTenantAccessPolicyConfigurationPartnerTenantId $partnerTenantId | Format-List

Then check actual sign-in behaviour, not just policy state. In the Entra admin centre, go to Identity > Monitoring & health > Sign-in logs, filter by Cross Tenant Access Type = B2B Collaboration, and inspect the Authentication Details tab for a real pilot guest sign-in. You are looking for the MFA requirement to be satisfied either by the home tenant’s claim, if inbound trust worked, or by your own Conditional Access challenge, if it did not but the fallback still enforced security. Both are acceptable outcomes; a sign-in with no MFA satisfaction recorded at all is not, and should stop the rollout.

Also review the policy’s report-only results. Open each pilot guest sign-in in the sign-in logs and check its Report-only tab (the Conditional Access tab also lists it), or use the Conditional Access Insights and reporting workbook, which needs sign-in logs sent to a Log Analytics workspace. A result of Report-only: User action required means the guest would have been prompted for MFA; Report-only: Failure means the sign-in would have been blocked. Do not flip to enforced until these results are clean for at least one full pilot user cycle, including a fresh sign-in after a token refresh, not just the first successful redemption.

Configuring Entra ID Cross-Tenant Access for B2B Guests architecture diagram 2

#Failure Modes and Common Traps

SymptomLikely causeFix
Guest cannot sign in, error indicates account does not exist in tenantUPN mismatch between invited email and actual home tenant identity, or redemption never completedResend invitation, confirm guest redeemed via the correct email, check the Entra ID users list for “Invitation accepted” state
Guest unexpectedly prompted to register or complete MFA in your tenant, or failing that challengeInbound trust not set, or the partner’s home tenant does not actually enforce MFA, so there is no claim to trustVerify inboundTrust.isMfaAccepted is true; if the partner has no MFA, your own CA MFA challenge must fire as fallback, confirm it is not excluded by a legacy policy
Outbound users cannot reach partner tenant resourcesThis procedure leaves outbound B2B collaboration at its documented default (allowed), so the block is elsewhere: the partner’s inbound settings do not admit your users, or someone has set b2bCollaborationOutbound to blocked in your default or partner configurationAsk the partner’s administrator to check their inbound settings for your tenant, and check b2bCollaborationOutbound in your own default and partner configurations
Old domain allow or block lists still apply despite new policyTenant has a legacy B2B allowlist or denylist configured under the authorisation policy from before cross-tenant access policy existedCheck Get-MgPolicyAuthorizationPolicy and legacy B2B management settings; these can override or conflict with the newer per-tenant policy
Guest sign-in succeeds but a later access review flags them as unauthorisedExternal collaboration invite restriction was not tightened before onboarding, so guests were added outside the sanctioned workflowAudit existing guest accounts against invitation source; enforce invite restriction retroactively and run an access review

The legacy allowlist trap catches more people than it should. Tenants that had B2B collaboration configured before cross-tenant access policy existed as a distinct object sometimes still carry old domain-based allow or deny lists under the authorisation policy. These silently override your carefully built partner configuration, and you will spend an afternoon convinced your JSON payload is wrong when it is actually correct and simply being ignored by an older setting nobody remembered to remove.

#Rollback

If the partner-specific configuration causes unexpected lockouts, export it before you change or remove anything, because the backup taken at the start of the procedure predates it. Be clear what removal does: the partner falls back to the default policy, which after this procedure blocks inbound B2B collaboration, so removing the object locks that partner’s guests out completely. Remove it only if that is the intended outcome, or after restoring the original default below; otherwise correct the trust or target settings from the export.

1Get-MgPolicyCrossTenantAccessPolicyPartner -CrossTenantAccessPolicyConfigurationPartnerTenantId $partnerTenantId | ConvertTo-Json -Depth 10 | Out-File ".\ca-partner-$partnerTenantId-backup.json"
2# Only if locking this partner out is the intended, approved outcome:
3Remove-MgPolicyCrossTenantAccessPolicyPartner -CrossTenantAccessPolicyConfigurationPartnerTenantId $partnerTenantId

To restore the tenant-wide default to its pre-change state, replay the backup captured at the start of the procedure:

1$saved = Get-Content .\ca-default-backup.json -Raw | ConvertFrom-Json
2$restore = @{
3  b2bCollaborationInbound = $saved.B2bCollaborationInbound
4  inboundTrust = $saved.InboundTrust
5}
6if (-not $restore.b2bCollaborationInbound -or -not $restore.inboundTrust) { throw "Backup is missing expected properties; inspect the file before restoring" }
7Update-MgPolicyCrossTenantAccessPolicyDefault -BodyParameter $restore

The backup is a serialised SDK object, so check its property names before relying on it, and compare the output of Get-MgPolicyCrossTenantAccessPolicyDefault with the backup after restoring.

To restore guest invite rights, set Guest invite restrictions back to the value recorded in guest-invite-backup.json, either in the portal or from the saved file in the same session (its Policy.ReadWrite.Authorization scope is the permission Microsoft lists for updating the authorization policy):

1$invite = Get-Content .\guest-invite-backup.json -Raw | ConvertFrom-Json
2if (-not $invite.AllowInvitesFrom) { throw "Backup has no AllowInvitesFrom value; inspect the file before restoring" }
3Update-MgPolicyAuthorizationPolicy -AllowInvitesFrom $invite.AllowInvitesFrom
4(Get-MgPolicyAuthorizationPolicy).AllowInvitesFrom

For the Conditional Access policy, set state back to enabledForReportingButNotEnforced immediately if you see unexpected blocks in production, rather than deleting the policy outright. This preserves your report-only telemetry while removing enforcement, which is the fastest safe reversal available. Only delete the policy object if you are abandoning the approach entirely, and even then, export it first with Get-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $id | ConvertTo-Json -Depth 10 so you are not rebuilding it from memory next sprint under time pressure.

#Operational Summary

Cross-tenant access configuration is not a one-off checkbox. It is a per-partner decision that has to be made deliberately every time a new external relationship is onboarded, and it needs to sit in your change log with the partner tenant ID, the date, and who approved it. The default posture should be restrictive: block by default, allow explicitly per tenant, and never assume a partner’s MFA claim is trustworthy until you have set inboundTrust.isMfaAccepted yourself and watched a real sign-in prove it in the logs. Pair every cross-tenant policy change with a Conditional Access rule running in report-only mode first, because the failure mode you are avoiding is not a security gap, it is a partner locked out of a live project with no clear diagnostic pointing at the cause. Keep your JSON backups from every change and log the partner tenant ID somewhere durable outside the ticket system; they are cheaper than rebuilding a policy from institutional memory during an incident call, and far cheaper than explaining to an auditor why a guest account has had standing access for eighteen months with nobody able to say who approved it.

#Learning Objectives

By the end of this procedure you should be able to distinguish the tenant-wide default cross-tenant access policy object from a partner-specific configuration object in Microsoft Graph, and explain that, as Microsoft documents, organisation-specific settings take precedence over the default settings for that tenant, while other controls such as legacy allow or deny lists and Conditional Access can still block access.

You should also be able to map the RBAC role assigned to your account against the specific Graph delegated or application permission scopes required for each cmdlet used, since Security Administrator and Conditional Access Administrator grant overlapping but not identical rights over cross-tenant access policy versus Conditional Access policy objects.

A further objective is reading the Authentication Details tab of a sign-in log entry well enough to distinguish an MFA claim satisfied by inbound trust from the partner's home tenant against one satisfied by your own Conditional Access challenge, since both appear as successful MFA but originate from different trust boundaries and carry different audit implications.

Finally, you should be able to identify legacy authorization policy allow or deny lists as a distinct, older configuration surface that can silently override a correctly built partner configuration, and know where to check for that override before assuming a policy payload is faulty.

#Prerequisites

Confirm the Microsoft.Graph PowerShell SDK installed is version 2.x or later with the Identity.SignIns module present; the CrossTenantAccessPolicy cmdlet family does not exist in the deprecated AzureAD or MSOnline modules, and older 1.x Graph SDK releases expose an incomplete subset of these cmdlets, which produces misleading 'cmdlet not found' errors rather than permission errors.

If Connect-MgGraph is being run under a custom app registration rather than interactively, confirm admin consent has already been granted for Policy.ReadWrite.CrossTenantAccess, Policy.ReadWrite.Authorization, Policy.Read.All, and Organization.Read.All at the app registration's API permissions blade; interactive sign-in as Global Administrator or Security Administrator can self-consent, but a service principal cannot, and the failure surfaces as an authorisation error only at the point the cmdlet executes, not at connection time.

Confirm licensing at the per-user level: Entra ID P1 is the floor for both Conditional Access and cross-tenant access policy enforcement. P2 is not required for this procedure but is worth noting as a distinct dependency if risk-based Conditional Access conditions are added later.

Confirm the partner side independently, not just your own tenant. Cross-tenant access is bidirectional; your inbound configuration will not produce a working collaboration if the partner tenant's administrator has not correspondingly enabled b2bCollaborationOutbound on their side. Ask the partner to confirm this explicitly rather than assuming it based on their willingness to collaborate.

Confirm sign-in log retention. Entra ID's default interactive sign-in log retention is short; if verification will span more than a few days, or if the change needs to be defensible in a later audit, confirm a diagnostic setting exporting sign-in logs to a Log Analytics workspace or storage account already exists before starting, since you cannot retroactively export logs that have already aged out.

Establish a dedicated pilot guest account, distinct from any production business user, before configuring the partner-specific policy, so that verification sign-ins do not touch live data or trigger unrelated access review flags.

#Worked Example

Consider onboarding a partner tenant referred to here as Meridian Logistics. After creating the partner configuration with isMfaAccepted set to true, the first pilot sign-in still shows an MFA challenge from your own Conditional Access policy rather than an inbound trust claim from Meridian's tenant. Checking Meridian's own claim, it turns out their organisation federates authentication through a third-party identity provider rather than enforcing MFA natively in Entra ID; the claim your tenant receives on the token does not carry the MFA amr value your inbound trust configuration expects, so the claim is not recognised even though isMfaAccepted is correctly set to true on your side.

This is not a misconfiguration on your part and does not require reverting the partner configuration. The correct interpretation is that your own Conditional Access MFA grant control is functioning as the intended fallback, exactly as designed when inbound trust cannot be satisfied. The validation step here is confirming, via the Authentication Details tab, that the MFA satisfaction method recorded is your own tenant's challenge rather than an absent or failed claim; a recorded successful challenge from either source is the acceptable outcome, an absent one is not.

Before widening the pilot to additional Meridian users, run Get-MgPolicyCrossTenantAccessPolicyPartner -CrossTenantAccessPolicyConfigurationPartnerTenantId against the specific tenant ID and inspect the returned inboundTrust object directly rather than relying on memory of what was submitted, since partial updates or a prior colleague's change can leave the live object different from what the original request intended. Compare the returned JSON field by field against the payload originally submitted.

If a subsequent change to Meridian's partner configuration causes a wider lockout than the single fallback-MFA pattern above, for example if outbound collaboration stops working after an unrelated default policy edit, follow the Rollback section: export the live partner object first, then correct the changed trust or target settings with Update-MgPolicyCrossTenantAccessPolicyPartner from the original partner JSON in the change log. Do not remove the object as a reset, because removal drops Meridian back to the restrictive default, which blocks inbound B2B collaboration and locks out every Meridian guest until the configuration is recreated.

About this page

Credited to

Dates

Published

Sources

This page lists no external sources.

Corrections

  • : Corrected during a review of published articles. Details
  • : Corrected during a review of published articles. Details
  • : Corrected during a review of published articles. Details
  • : Corrected during a review of published articles. Details
Reader Interaction

Comments

Add a thoughtful note on Configuring Entra ID Cross-Tenant Access for B2B Guests. Comments are checked for spam and held for moderation before appearing.

Loading comments...

Discover more

Learn More About KBY

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Build practical engineering skills.

Receive new lessons, learning paths, practical exercises and early-career guidance.