Multi-Tenant B2B Sync with MIM Graph Connector

Published 05-24-2021 01:09 PM 1,424 Views
Microsoft

 

Hello everyone, this is David Loder again, sporting Microsoft’s new Customer Engineer title, but still a Hybrid Identity engineer from Detroit. Over the past year I’ve seen an uptick in requests from customers looking to modernize their GALSync solution. Either they’re wanting to control use of SharePoint and Teams B2B capabilities or looking to enable a GALSync with a cloud-only organization. And they’re asking for assistance and guidance that I hope to provide today.

 

Before I get started on how Microsoft Identity Manger (MIM) 2016 can help provide the basis for a supported GALSync solution, I want to ensure everyone knows that Microsoft provides a managed service SaaS offering to help with any multi-tenant syncing scenarios. It’s called Active Directory Synchronization Service (ADSS) and does all the back-end tenant syncing automagically. The great benefit with ADSS is that it’s a fully supported solution.  MIM as a product is fully supported, but as has always been the case, any customizations put into it are best-effort support. Reach out to your account team if you want more information about ADSS. Now on with the MIM discussion.

 

Historically, Microsoft has provided a supported GALSync solution in our on-premises sync engine, MIM. Documentation on the GALSync configuration was first provided back in the Microsoft Identity Integration Server (MIIS) 2003 timeframe. Additional documentation is available at the GALSync Resources Wiki. Despite its age, that guidance still holds true today. But it is limited to an Active Directory to Active Directory user to contact sync design.

 

Today, we offer the Microsoft Graph Connector. It provides the ability to connect to an Azure AD tenant, and to manage B2B invitations. However, it is not a drop-in replacement for GALSync. We can get there, but we need to fill in some missing components.

 

There are many scenarios that Graph Connector could satisfy, and they can get increasingly difficult. For this blog I’ll focus on the simplest scenario and then discuss what considerations one would have in order to move to more complex scenarios.

 

In a classic GALSync solution, we sync users from a partner AD to become contacts in our home AD. For this Azure AD replacement, we want to sync users from a partner tenant, and make them B2B users in our home tenant. This assumes that you’ve moved past the point where you need identical GALs in both on-premises Exchange and Exchange Online. Most of the customers I work with have gotten to that point. Maybe they still have some service account mailboxes left to move, but all humans who need to view a GAL have been moved to Exchange Online. That simplifies the requirements as there’s no longer a need for creating on-premises objects for Exchange to use.

 

The first component we need is MIM 2016. If you are an Azure AD Premium customer, MIM is still fully supported and still available for download. Otherwise, MIM is in extended support through 2026. To keep our infrastructure footprint small, this solution will use only a Sync Service install, and will not use the Portal or any declarative provisioning.

 

With a base MIM install in place we’re almost ready to make a Graph connection to our first tenant. But before we do so, we need to have a discussion of scope, because scope is the major factor in determining the complexity of solution. When talking about scope, I’m going to be very exact in terms of objects and attributes as much of our terminology in this space is vague and subject to perspective to understand meaning.

 

“We want users from a partner tenant….” Starting with this phrase, we need to break it down to a scoped object and attribute definition. The Graph Connector exposes user and contact (technically orgContact) object classes. We will only want to bring in users from the partner tenant. Except the user object class covers both internal and external (a.k.a. B2B) users. Typically, we only want to bring in the internal users from the partner tenant. We can tell the difference between them because external users have a creationType attribute equal to ‘Invitation’, whereas internal users have a null creationType. The other possible choice one might consider is the userType attribute with values of either ‘Guest’ or ‘Member’. But I think that is a poor choice. Internal users are Member by default and external users are Guest by default, but userType can be changed for both. Guest vs. Member only controls one’s default visibility to certain workloads such as SharePoint or Azure AD itself. Guest is sometimes incorrectly used interchangeably with B2B, but those two terms are not equivalent.

 

“Make B2B users in our home tenant….” Given the previous discussion, this phrase is now rather easy to scope. We’ll be looking at user objects with creationType=’Invitation’.

 

With our purposefully simplistic scope defined, let’s build the first Graph connection to the partner tenant. Install the Graph Connector on the MIM system. There have been lots of fixes recently so be sure to use the current version.

 

Start with creating a new Graph (Microsoft) connector.

PartnerTenantMA.png

 

Provide registered app credentials to connect to the partner tenant. The app registration needs at least User.Read.All and Directory.Read.All, with Admin consent. This is an example from one of my temporary demo tenants.

PartnerTenantConnectivity.png

 

On the Schema 1 page, keep the Add objects filter unchecked. Unfortunately, we cannot use the filtering capability to return only the internal users where creationType is null. The Graph API provides more advanced filtering capabilities, but it requires a Header value to be set, which the Graph Connector does not currently expose as a configurable setting.

 

On the Select Object Types page check user.

 

On the Select Attributes page, let’s select a minimum number of attributes to enable decent GAL functionality as part of the B2B sync. Additional attributes can be added if the GAL needs to be more fully populated. Select creationType, displayName, givenName, id, mail, showInAddressList, and surname.

PartnerTenantAttributes.png

 

The anchor attribute on the Configure Anchors page will automatically be set to id.

 

On the Configure Connector Filter page, I will keep this example simple by using a declared filter of creationType Is present. This will filter out any external users that may happen to already exist in the partner tenant. But this filtering will come at the expense of increased Delta Sync times due to having to process each filtered disconnector every sync cycle.

PartnerTenantFilter.png

 

For Configure Join and Projection Rules, we’ll join on id first, mail second, otherwise project as a person.

PartnerTenantJoinAndProjection.png

 

This is the inbound partner tenant user flow, so provide a direct inbound flow for each attribute. Several of the selected attributes are not default metaverse attributes, so the metaverse schema will need to be extended to account for these attributes.

PartnerTenantAttributeFlow.png

 

Leave the Configure Deprovisioning page at the default of ‘Make them disconnectors’ and Configure Extensions page will also be left at its default of empty.

 

Create the Full Import and Full Sync run profiles. Execute them to confirm that the partner tenant users are projected into the metaverse. Also create the Delta Import and Delta Sync run profiles. We won’t use them now, but will need them later. I’ve gotten spoiled from AADC creating run profiles by default.

 

Now that the inbound side from the partner tenant is complete, let’s create the outbound side for the home tenant. The setup will be similar to the inbound side, but with some minor changes.

 

The App Registration in the home tenant will require the Directory.Read.All and User.ReadWrite.All permissions. There is a User.Invite.All permission, but since we need to sync GAL attributes after the invite, that permission does not provide enough access for this scenario.

For the Schema 1 page, we’ll need to leave the Add objects filter checkbox uncheck again. Even though we could technically set a graph filter of creationType eq 'Invitation', using a filter breaks Delta Imports for the Graph Connector (with a no-start-ma error). We will have to continue to use MIM filtering the keep the scope correct since Delta Imports are very important for most of my customers.

 

On the Global Parameters page set the Invite redirect URL to https://myapps.microsoft.com/?tenantid=GUIDValue. Leave the send mail checkbox unchecked unless you want to start automatically spamming all your invitees.

HomeTenantGlobal.png

 

On the Select Attributes page, include userPrincipalName and userType in addition to the list of attributes from the inbound side. We’re selecting UPN just so we can see the full results of the invitation process, not because we’ll be doing any syncing of that attribute.

For the Configure Connector Filter page, we reverse it from the inbound partner tenant setting and use a filter of creationType Is not present.

 

On the Configure Join and Projection Rules page, only add the Join Rule for mail. There should be no Projection Rule as we want all the external users to project into the metaverse from the inbound partner tenant.

 

For the Configure Attribute Flow page, add a direct export (allowing nulls) for displayName, givenName, mail, showInAddressList and surname. Add a constant export of Guest for userType. While an external user is typically Guest by default, the Graph Connector defaults to Member, so we need to override that. Also add a constant export of Invitation for creationType. For the creationType, we’re flowing that just to satisfy the MA filter, not that it affects the invitation process.

HomeTenantAttributeFlow.png

 

On the Configure Deprovisioning page, change the selection to Stage a delete on the object for the next export run.

 

Create and run the Full Import and Full Sync run profiles. If there are any matching mail values for existing external users those should join. Otherwise, the existing external users will show up as disconnectors. Also create the Delta Import, Delta Sync and Export run profiles. We won’t use them now, but will need them later.

 

Finally, we need a small amount of provisioning code to provision the external users from the metaverse into the home tenant MA. From the Tools > Options… menu check the Enable metaverse rules extension checkbox. Then click the Create Rules Extension Project… button. I’ll provide sample code for Visual C#, so choose that selection and the version of Visual Studio to use to compile the project.

 

This is a sample implementation for the IMVSynchronization.Provision method.

 

void IMVSynchronization.Provision (MVEntry mventry)

{

    string container = "OBJECT=user";

    string rdn = "CN=" + Guid.NewGuid().ToString();

    ConnectedMA HomeTenantMA = mventry.ConnectedMAs["HomeTenant"];

    ReferenceValue dn = HomeTenantMA.EscapeDNComponent(rdn).Concat(container);

    int numConnectors = HomeTenantMA.Connectors.Count;

 

    // If there is no connector present, create a new connector.

    if (numConnectors == 0)

    {

        CSEntry csentry = HomeTenantMA.Connectors.StartNewConnector("user");

        csentry.DN = dn;

        csentry["id"].StringValue = Guid.NewGuid().ToString();

        csentry.CommitNewConnector();

    }

    else if (numConnectors == 1)

    {

        //Do nothing, no rename is needed

    }

    else

    {

        throw (new UnexpectedDataException("multiple connectors:" + numConnectors.ToString()));

    }

}     

 

A few things to note in this code. We need the name of the home tenant MA as the connected MA we are managing. We also set a random GUID-based DN and id in order to successfully export the invitation, but those values will be replaced by the real Azure AD values during the first confirming import.

 

Build the solution in Visual Studio and make sure the extension DLL gets copied to the Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions folder. Back in the Options dialog, ensure the DLL that was just created is selected for the Rules extension name, and check the Enable Provisioning Rules Extension checkbox.

Options.png

 

To begin with a small test, pick a sample user from the partner tenant MA and commit a Full Sync Preview against them. That should generate a pending export in the home tenant MA.

HomeTenantPendingExport.png

 

The small piece of magic with the Graph Connector is that if a user has a pending add with mail but no UPN, they will go through the invitation process to make them an external user, rather than being created as an internal user. We can see the pending export with the temporary DN and id, the GALSync attributes we wired up, and our constant userType of Guest. This test user has an OnMicrosoft.com mail address in the partner tenant as I have not added a custom domain to that tenant. The actual mail value is ultimately immaterial so long as it doesn’t already belong to the destination tenant.

 

Run the Export, followed by a confirming Delta Import.

HomeTenantConfirmingImport.png

 

We see that the user got successfully invited, got its real DN and id and has all the attributes we set. Notice the UPN got automatically set by AAD in the expected format of mail#EXT#@tenant. It also was given a default setting of showInAddressList = false. By default, invited external users are hidden from the GAL.

 

Complete a second delta sync cycle (Delta Import, Delta Sync, Export) and showInAddressList should get set to its synced value. For this example user, that would be a null value.

HomeTenantPendingExport2.png

 

After exporting the updated showInAddressList value, we can confirm that our GALSync is functional. Log in to Outlook on the web in the home tenant, open the People app and select the All Users GAL. We should see our newly synced user present in the GAL.

HomeTenantGAL.png

 

Finally, to complete the deprovisioning aspect of the GALSync, configure the Object Deletion Rule for the person object class to delete the metaverse object when the partner tenant connector is disconnected, and set the MA's Deprovisioning action to Stage a delete. This way, a deletion of the user from the partner tenant will cascade a delete of the external B2B user to our home tenant.

 

That’s the end of the setup for GALSync from a single source to a single destination tenant.

 

As I alluded to at the beginning, more complex setups are possible. Consider a bi-directional GALSync where the partner tenant also needs the users from our home tenant. One way to keep the architecture simple is to maintain one MIM instance per tenant; we simply duplicate this setup in the opposite direction. This is identical to the AADC architecture where one AADC is needed for each tenant. It allows the provisioning code to know the tenant for which it is responsible, cleanly separates inbound from outbound flows and causes no precedence problems. It also allows the partner to control the app registration which possesses write access into their tenant.

 

Or consider a full-mesh setup where the tenants are all peers in one org that decided to segment their tenants for some reason. We could design a single MIM solution that manages every tenant. We could do two connectors to each tenant to allow us to separate internal user from external and continue to manage the flows separately. We’d only have to prevent same-tenant provisioning in the provisioning code. I could also see a solution that uses only one connector to each tenant. We could come up with a mechanism to track authority of address spaces, so we know which source tenant is responsible for each user and use that knowledge to then create the external B2B users in the other tenants.

 

For larger deployments where we might have concern about the number of disconnectors and corresponding delta sync times, there are a few advanced techniques we could implement to alleviate that concern. We could project and terminate objects in the metaverse instead of keeping them as disconnectors. Or we could replace the Graph Connector with a PowerShell Connector and take care of all the Graph logic ourselves, avoiding the scenarios where the Graph Connector has limitations.

 

Hopefully, this has shed some light on considerations for a modern GALSync solution.

 

Thanks for spending a little bit of your time with me.

-Dave

 

Disclaimer: The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

%3CLINGO-SUB%20id%3D%22lingo-sub-2381682%22%20slang%3D%22en-US%22%3EMulti-Tenant%20B2B%20Sync%20with%20MIM%20Graph%20Connector%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381682%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHello%20everyone%2C%20this%20is%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fprofile%2Fdavid%2520%2520loder%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EDavid%20Loder%3C%2FA%3E%20again%2C%20sporting%20Microsoft%E2%80%99s%20new%20Customer%20Engineer%20title%2C%20but%20still%20a%20Hybrid%20Identity%20engineer%20from%20Detroit.%20Over%20the%20past%20year%20I%E2%80%99ve%20seen%20an%20uptick%20in%20requests%20from%20customers%20looking%20to%20modernize%20their%20GALSync%20solution.%20Either%20they%E2%80%99re%20wanting%20to%20control%20use%20of%20SharePoint%20and%20Teams%20B2B%20capabilities%20or%20looking%20to%20enable%20a%20GALSync%20with%20a%20cloud-only%20organization.%20And%20they%E2%80%99re%20asking%20for%20assistance%20and%20guidance%20that%20I%20hope%20to%20provide%20today.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20I%20get%20started%20on%20how%20Microsoft%20Identity%20Manger%20(MIM)%202016%20can%20help%20provide%20the%20basis%20for%20a%20supported%20GALSync%20solution%2C%20I%20want%20to%20ensure%20everyone%20knows%20that%20Microsoft%20provides%20a%20managed%20service%20SaaS%20offering%20to%20help%20with%20any%20multi-tenant%20syncing%20scenarios.%20It%E2%80%99s%20called%20Active%20Directory%20Synchronization%20Service%20(ADSS)%20and%20does%20all%20the%20back-end%20tenant%20syncing%20automagically.%20The%20great%20benefit%20with%20ADSS%20is%20that%20it%E2%80%99s%20a%20fully%20supported%20solution.%26nbsp%3B%20MIM%20as%20a%20product%20is%20fully%20supported%2C%20but%20as%20has%20always%20been%20the%20case%2C%20any%20customizations%20put%20into%20it%20are%20best-effort%20support.%20Reach%20out%20to%20your%20account%20team%20if%20you%20want%20more%20information%20about%20ADSS.%20Now%20on%20with%20the%20MIM%20discussion.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHistorically%2C%20Microsoft%20has%20provided%20a%20supported%20GALSync%20solution%20in%20our%20on-premises%20sync%20engine%2C%20MIM.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fmim%2Fcc720550(v%3Dws.10)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%20on%20the%20GALSync%20configuration%3C%2FA%3E%20was%20first%20provided%20back%20in%20the%20Microsoft%20Identity%20Integration%20Server%20(MIIS)%202003%20timeframe.%20Additional%20documentation%20is%20available%20at%20the%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2FGALSyncResources%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGALSync%20Resources%20Wiki%3C%2FA%3E.%20Despite%20its%20age%2C%20that%20guidance%20still%20holds%20true%20today.%20But%20it%20is%20limited%20to%20an%20Active%20Directory%20to%20Active%20Directory%20user%20to%20contact%20sync%20design.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EToday%2C%20we%20offer%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-identity-manager%2Fmicrosoft-identity-manager-2016-connector-graph%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Graph%20Connector%3C%2FA%3E.%20It%20provides%20the%20ability%20to%20connect%20to%20an%20Azure%20AD%20tenant%2C%20and%20to%20manage%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fexternal-identities%2Fwhat-is-b2b%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EB2B%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fexternal-identities%2Fcode-samples%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Einvitations%3C%2FA%3E.%20However%2C%20it%20is%20not%20a%20drop-in%20replacement%20for%20GALSync.%20We%20can%20get%20there%2C%20but%20we%20need%20to%20fill%20in%20some%20missing%20components.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20many%20scenarios%20that%20Graph%20Connector%20could%20satisfy%2C%20and%20they%20can%20get%20increasingly%20difficult.%20For%20this%20blog%20I%E2%80%99ll%20focus%20on%20the%20simplest%20scenario%20and%20then%20discuss%20what%20considerations%20one%20would%20have%20in%20order%20to%20move%20to%20more%20complex%20scenarios.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20a%20classic%20GALSync%20solution%2C%20we%20sync%20users%20from%20a%20partner%20AD%20to%20become%20contacts%20in%20our%20home%20AD.%20For%20this%20Azure%20AD%20replacement%2C%20we%20want%20to%20sync%20users%20from%20a%20partner%20tenant%2C%20and%20make%20them%20B2B%20users%20in%20our%20home%20tenant.%20This%20assumes%20that%20you%E2%80%99ve%20moved%20past%20the%20point%20where%20you%20need%20identical%20GALs%20in%20both%20on-premises%20Exchange%20and%20Exchange%20Online.%20Most%20of%20the%20customers%20I%20work%20with%20have%20gotten%20to%20that%20point.%20Maybe%20they%20still%20have%20some%20service%20account%20mailboxes%20left%20to%20move%2C%20but%20all%20humans%20who%20need%20to%20view%20a%20GAL%20have%20been%20moved%20to%20Exchange%20Online.%20That%20simplifies%20the%20requirements%20as%20there%E2%80%99s%20no%20longer%20a%20need%20for%20creating%20on-premises%20objects%20for%20Exchange%20to%20use.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20first%20component%20we%20need%20is%20MIM%202016.%20If%20you%20are%20an%20Azure%20AD%20Premium%20customer%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-identity-manager%2Fsupport-update-for-azure-active-directory-premium-customers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMIM%20is%20still%20fully%20supported%3C%2FA%3E%20and%20still%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FMIMforAADP%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eavailable%20for%20download%3C%2FA%3E.%20Otherwise%2C%20MIM%20is%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flifecycle%2Fproducts%2Fmicrosoft-identity-manager-2016%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eextended%20support%3C%2FA%3E%20through%202026.%20To%20keep%20our%20infrastructure%20footprint%20small%2C%20this%20solution%20will%20use%20only%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-identity-manager%2Finstall-mim-sync%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESync%20Service%20install%3C%2FA%3E%2C%20and%20will%20not%20use%20the%20Portal%20or%20any%20declarative%20provisioning.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20a%20base%20MIM%20install%20in%20place%20we%E2%80%99re%20almost%20ready%20to%20make%20a%20Graph%20connection%20to%20our%20first%20tenant.%20But%20before%20we%20do%20so%2C%20we%20need%20to%20have%20a%20discussion%20of%20scope%2C%20because%20scope%20is%20the%20major%20factor%20in%20determining%20the%20complexity%20of%20solution.%20When%20talking%20about%20scope%2C%20I%E2%80%99m%20going%20to%20be%20very%20exact%20in%20terms%20of%20objects%20and%20attributes%20as%20much%20of%20our%20terminology%20in%20this%20space%20is%20vague%20and%20subject%20to%20perspective%20to%20understand%20meaning.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CWe%20want%20users%20from%20a%20partner%20tenant%E2%80%A6.%E2%80%9D%20Starting%20with%20this%20phrase%2C%20we%20need%20to%20break%20it%20down%20to%20a%20scoped%20object%20and%20attribute%20definition.%20The%20Graph%20Connector%20exposes%20user%20and%20contact%20(technically%20orgContact)%20object%20classes.%20We%20will%20only%20want%20to%20bring%20in%20users%20from%20the%20partner%20tenant.%20Except%20the%20user%20object%20class%20covers%20both%20internal%20and%20external%20(a.k.a.%20B2B)%20users.%20Typically%2C%20we%20only%20want%20to%20bring%20in%20the%20internal%20users%20from%20the%20partner%20tenant.%20We%20can%20tell%20the%20difference%20between%20them%20because%20external%20users%20have%20a%20creationType%20attribute%20equal%20to%20%E2%80%98Invitation%E2%80%99%2C%20whereas%20internal%20users%20have%20a%20null%20creationType.%20The%20other%20possible%20choice%20one%20might%20consider%20is%20the%20userType%20attribute%20with%20values%20of%20either%20%E2%80%98Guest%E2%80%99%20or%20%E2%80%98Member%E2%80%99.%20But%20I%20think%20that%20is%20a%20poor%20choice.%20Internal%20users%20are%20Member%20by%20default%20and%20external%20users%20are%20Guest%20by%20default%2C%20but%20userType%20can%20be%20changed%20for%20both.%20Guest%20vs.%20Member%20only%20controls%20one%E2%80%99s%20default%20visibility%20to%20certain%20workloads%20such%20as%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-365%2Fsolutions%2Fcollaborate-in-site%3Fview%3Do365-worldwide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESharePoint%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fenterprise-users%2Fusers-restrict-guest-permissions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20AD%3C%2FA%3E%20itself.%20Guest%20is%20sometimes%20incorrectly%20used%20interchangeably%20with%20B2B%2C%20but%20those%20two%20terms%20are%20not%20equivalent.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9CMake%20B2B%20users%20in%20our%20home%20tenant%E2%80%A6.%E2%80%9D%20Given%20the%20previous%20discussion%2C%20this%20phrase%20is%20now%20rather%20easy%20to%20scope.%20We%E2%80%99ll%20be%20looking%20at%20user%20objects%20with%20creationType%3D%E2%80%99Invitation%E2%80%99.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20our%20purposefully%20simplistic%20scope%20defined%2C%20let%E2%80%99s%20build%20the%20first%20Graph%20connection%20to%20the%20partner%20tenant.%20Install%20the%20Graph%20Connector%20on%20the%20MIM%20system.%20There%20have%20been%20lots%20of%20fixes%20recently%20so%20be%20sure%20to%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fdownload%2Fdetails.aspx%3Fid%3D51495%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecurrent%20version%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStart%20with%20creating%20a%20new%20Graph%20(Microsoft)%20connector.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantMA.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283186i9FC9CDF5C36B107A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantMA.png%22%20alt%3D%22PartnerTenantMA.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EProvide%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-identity-manager%2Fmicrosoft-identity-manager-2016-connector-graph%23authorizing-the-connector-to-retrieve-or-manage-objects-in-your-azure-ad-directory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eregistered%20app%20credentials%3C%2FA%3E%20to%20connect%20to%20the%20partner%20tenant.%20The%20app%20registration%20needs%20at%20least%20User.Read.All%20and%20Directory.Read.All%2C%20with%20Admin%20consent.%20This%20is%20an%20example%20from%20one%20of%20my%20temporary%20demo%20tenants.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantConnectivity.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283187iD22BF9D6F3769836%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantConnectivity.png%22%20alt%3D%22PartnerTenantConnectivity.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Schema%201%20page%2C%20keep%20the%20Add%20objects%20filter%20unchecked.%20Unfortunately%2C%20we%20cannot%20use%20the%20filtering%20capability%20to%20return%20only%20the%20internal%20users%20where%20creationType%20is%20null.%20The%20Graph%20API%20provides%20more%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fidentity%2Fblogs%2Fmicrosoft-graph-advanced-queries-for-directory-objects-are-now-generally-available%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eadvanced%20filtering%20capabilities%3C%2FA%3E%2C%20but%20it%20requires%20a%20Header%20value%20to%20be%20set%2C%20which%20the%20Graph%20Connector%20does%20not%20currently%20expose%20as%20a%20configurable%20setting.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Select%20Object%20Types%20page%20check%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Select%20Attributes%20page%2C%20let%E2%80%99s%20select%20a%20minimum%20number%20of%20attributes%20to%20enable%20decent%20GAL%20functionality%20as%20part%20of%20the%20B2B%20sync.%20Additional%20attributes%20can%20be%20added%20if%20the%20GAL%20needs%20to%20be%20more%20fully%20populated.%20Select%20creationType%2C%20displayName%2C%20givenName%2C%20id%2C%20mail%2C%20showInAddressList%2C%20and%20surname.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantAttributes.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283188i7661D1EA0F182D57%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantAttributes.png%22%20alt%3D%22PartnerTenantAttributes.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20anchor%20attribute%20on%20the%20Configure%20Anchors%20page%20will%20automatically%20be%20set%20to%20id.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Configure%20Connector%20Filter%20page%2C%20I%20will%20keep%20this%20example%20simple%20by%20using%20a%20declared%20filter%20of%20creationType%20Is%20present.%20This%20will%20filter%20out%20any%20external%20users%20that%20may%20happen%20to%20already%20exist%20in%20the%20partner%20tenant.%20But%20this%20filtering%20will%20come%20at%20the%20expense%20of%20increased%20Delta%20Sync%20times%20due%20to%20having%20to%20process%20each%20filtered%20disconnector%20every%20sync%20cycle.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantFilter.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283189i43B931E19B78956F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantFilter.png%22%20alt%3D%22PartnerTenantFilter.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20Configure%20Join%20and%20Projection%20Rules%2C%20we%E2%80%99ll%20join%20on%20id%20first%2C%20mail%20second%2C%20otherwise%20project%20as%20a%20person.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantJoinAndProjection.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283190i6BE7E160C2703115%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantJoinAndProjection.png%22%20alt%3D%22PartnerTenantJoinAndProjection.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20the%20inbound%20partner%20tenant%20user%20flow%2C%20so%20provide%20a%20direct%20inbound%20flow%20for%20each%20attribute.%20Several%20of%20the%20selected%20attributes%20are%20not%20default%20metaverse%20attributes%2C%20so%20the%20metaverse%20schema%20will%20need%20to%20be%20extended%20to%20account%20for%20these%20attributes.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PartnerTenantAttributeFlow.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283191i0603C3786DA16F99%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22PartnerTenantAttributeFlow.png%22%20alt%3D%22PartnerTenantAttributeFlow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELeave%20the%20Configure%20Deprovisioning%20page%20at%20the%20default%20of%20%E2%80%98Make%20them%20disconnectors%E2%80%99%20and%20Configure%20Extensions%20page%20will%20also%20be%20left%20at%20its%20default%20of%20empty.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECreate%20the%20Full%20Import%20and%20Full%20Sync%20run%20profiles.%20Execute%20them%20to%20confirm%20that%20the%20partner%20tenant%20users%20are%20projected%20into%20the%20metaverse.%20Also%20create%20the%20Delta%20Import%20and%20Delta%20Sync%20run%20profiles.%20We%20won%E2%80%99t%20use%20them%20now%2C%20but%20will%20need%20them%20later.%20I%E2%80%99ve%20gotten%20spoiled%20from%20AADC%20creating%20run%20profiles%20by%20default.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20the%20inbound%20side%20from%20the%20partner%20tenant%20is%20complete%2C%20let%E2%80%99s%20create%20the%20outbound%20side%20for%20the%20home%20tenant.%20The%20setup%20will%20be%20similar%20to%20the%20inbound%20side%2C%20but%20with%20some%20minor%20changes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20App%20Registration%20in%20the%20home%20tenant%20will%20require%20the%20Directory.Read.All%20and%20User.ReadWrite.All%20permissions.%20There%20is%20a%20User.Invite.All%20permission%2C%20but%20since%20we%20need%20to%20sync%20GAL%20attributes%20after%20the%20invite%2C%20that%20permission%20does%20not%20provide%20enough%20access%20for%20this%20scenario.%3C%2FP%3E%0A%3CP%3EFor%20the%20Schema%201%20page%2C%20we%E2%80%99ll%20need%20to%20leave%20the%20Add%20objects%20filter%20checkbox%20uncheck%20again.%20Even%20though%20we%20could%20technically%20set%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fquery-parameters%23filter-parameter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Egraph%20filter%3C%2FA%3E%20of%20creationType%20eq%20'Invitation'%2C%20using%20a%20filter%20breaks%20Delta%20Imports%20for%20the%20Graph%20Connector%20(with%20a%20no-start-ma%20error).%20We%20will%20have%20to%20continue%20to%20use%20MIM%20filtering%20the%20keep%20the%20scope%20correct%20since%20Delta%20Imports%20are%20very%20important%20for%20most%20of%20my%20customers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Global%20Parameters%20page%20set%20the%20Invite%20redirect%20URL%20to%20%3CA%20href%3D%22https%3A%2F%2Fmyapps.microsoft.com%2F%3Ftenantid%3DGUIDValue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmyapps.microsoft.com%2F%3Ftenantid%3DGUIDValue%3C%2FA%3E.%20Leave%20the%20send%20mail%20checkbox%20unchecked%20unless%20you%20want%20to%20start%20automatically%20spamming%20all%20your%20invitees.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantGlobal.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283192iB4E7655F0C4F3558%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantGlobal.png%22%20alt%3D%22HomeTenantGlobal.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Select%20Attributes%20page%2C%20include%20userPrincipalName%20and%20userType%20in%20addition%20to%20the%20list%20of%20attributes%20from%20the%20inbound%20side.%20We%E2%80%99re%20selecting%20UPN%20just%20so%20we%20can%20see%20the%20full%20results%20of%20the%20invitation%20process%2C%20not%20because%20we%E2%80%99ll%20be%20doing%20any%20syncing%20of%20that%20attribute.%3C%2FP%3E%0A%3CP%3EFor%20the%20Configure%20Connector%20Filter%20page%2C%20we%20reverse%20it%20from%20the%20inbound%20partner%20tenant%20setting%20and%20use%20a%20filter%20of%20creationType%20Is%20not%20present.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Configure%20Join%20and%20Projection%20Rules%20page%2C%20only%20add%20the%20Join%20Rule%20for%20mail.%20There%20should%20be%20no%20Projection%20Rule%20as%20we%20want%20all%20the%20external%20users%20to%20project%20into%20the%20metaverse%20from%20the%20inbound%20partner%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20the%20Configure%20Attribute%20Flow%20page%2C%20add%20a%20direct%20export%20(allowing%20nulls)%20for%20displayName%2C%20givenName%2C%20mail%2C%20showInAddressList%20and%20surname.%20Add%20a%20constant%20export%20of%20Guest%20for%20userType.%20While%20an%20external%20user%20is%20typically%20Guest%20by%20default%2C%20the%20Graph%20Connector%20defaults%20to%20Member%2C%20so%20we%20need%20to%20override%20that.%20Also%20add%20a%20constant%20export%20of%20Invitation%20for%20creationType.%20For%20the%20creationType%2C%20we%E2%80%99re%20flowing%20that%20just%20to%20satisfy%20the%20MA%20filter%2C%20not%20that%20it%20affects%20the%20invitation%20process.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantAttributeFlow.png%22%20style%3D%22width%3A%20654px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283193iE846FFFA70FB8335%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantAttributeFlow.png%22%20alt%3D%22HomeTenantAttributeFlow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20Configure%20Deprovisioning%20page%2C%20change%20the%20selection%20to%20Stage%20a%20delete%20on%20the%20object%20for%20the%20next%20export%20run.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECreate%20and%20run%20the%20Full%20Import%20and%20Full%20Sync%20run%20profiles.%20If%20there%20are%20any%20matching%20mail%20values%20for%20existing%20external%20users%20those%20should%20join.%20Otherwise%2C%20the%20existing%20external%20users%20will%20show%20up%20as%20disconnectors.%20Also%20create%20the%20Delta%20Import%2C%20Delta%20Sync%20and%20Export%20run%20profiles.%20We%20won%E2%80%99t%20use%20them%20now%2C%20but%20will%20need%20them%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinally%2C%20we%20need%20a%20small%20amount%20of%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fwindows%2Fdesktop%2Fidentity-lifecycle-manager%2Fms696017(v%3Dvs.85)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eprovisioning%20code%3C%2FA%3E%20to%20provision%20the%20external%20users%20from%20the%20metaverse%20into%20the%20home%20tenant%20MA.%20From%20the%20Tools%20%26gt%3B%20Options%E2%80%A6%20menu%20check%20the%20Enable%20metaverse%20rules%20extension%20checkbox.%20Then%20click%20the%20Create%20Rules%20Extension%20Project%E2%80%A6%20button.%20I%E2%80%99ll%20provide%20sample%20code%20for%20Visual%20C%23%2C%20so%20choose%20that%20selection%20and%20the%20version%20of%20Visual%20Studio%20to%20use%20to%20compile%20the%20project.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20a%20sample%20implementation%20for%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fwindows%2Fdesktop%2Fforefront-2010%2Fff771493(v%3Dvs.100)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIMVSynchronization.Provision%3C%2FA%3E%20method.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Evoid%20IMVSynchronization.Provision%20(MVEntry%20mventry)%3C%2FP%3E%0A%3CP%3E%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20string%20container%20%3D%20%22OBJECT%3Duser%22%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20string%20rdn%20%3D%20%22CN%3D%22%20%2B%20Guid.NewGuid().ToString()%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ConnectedMA%20HomeTenantMA%20%3D%20mventry.ConnectedMAs%5B%22HomeTenant%22%5D%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ReferenceValue%20dn%20%3D%20HomeTenantMA.EscapeDNComponent(rdn).Concat(container)%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20int%20numConnectors%20%3D%20HomeTenantMA.Connectors.Count%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20If%20there%20is%20no%20connector%20present%2C%20create%20a%20new%20connector.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20if%20(numConnectors%20%3D%3D%200)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CSEntry%20csentry%20%3D%20HomeTenantMA.Connectors.StartNewConnector(%22user%22)%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20csentry.DN%20%3D%20dn%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20csentry%5B%22id%22%5D.StringValue%20%3D%20Guid.NewGuid().ToString()%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20csentry.CommitNewConnector()%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20else%20if%20(numConnectors%20%3D%3D%201)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2FDo%20nothing%2C%20no%20rename%20is%20needed%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20else%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20throw%20(new%20UnexpectedDataException(%22multiple%20connectors%3A%22%20%2B%20numConnectors.ToString()))%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%0A%3CP%3E%7D%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20few%20things%20to%20note%20in%20this%20code.%20We%20need%20the%20name%20of%20the%20home%20tenant%20MA%20as%20the%20connected%20MA%20we%20are%20managing.%20We%20also%20set%20a%20random%20GUID-based%20DN%20and%20id%20in%20order%20to%20successfully%20export%20the%20invitation%2C%20but%20those%20values%20will%20be%20replaced%20by%20the%20real%20Azure%20AD%20values%20during%20the%20first%20confirming%20import.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBuild%20the%20solution%20in%20Visual%20Studio%20and%20make%20sure%20the%20extension%20DLL%20gets%20copied%20to%20the%20Microsoft%20Forefront%20Identity%20Manager%5C2010%5CSynchronization%20Service%5CExtensions%20folder.%20Back%20in%20the%20Options%20dialog%2C%20ensure%20the%20DLL%20that%20was%20just%20created%20is%20selected%20for%20the%20Rules%20extension%20name%2C%20and%20check%20the%20Enable%20Provisioning%20Rules%20Extension%20checkbox.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Options.png%22%20style%3D%22width%3A%20506px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283194iBD4B285383D41955%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Options.png%22%20alt%3D%22Options.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20begin%20with%20a%20small%20test%2C%20pick%20a%20sample%20user%20from%20the%20partner%20tenant%20MA%20and%20commit%20a%20Full%20Sync%20Preview%20against%20them.%20That%20should%20generate%20a%20pending%20export%20in%20the%20home%20tenant%20MA.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantPendingExport.png%22%20style%3D%22width%3A%20690px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283198i23DBF1BF265D6359%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantPendingExport.png%22%20alt%3D%22HomeTenantPendingExport.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20small%20piece%20of%20magic%20with%20the%20Graph%20Connector%20is%20that%20if%20a%20user%20has%20a%20pending%20add%20with%20mail%20but%20no%20UPN%2C%20they%20will%20go%20through%20the%20invitation%20process%20to%20make%20them%20an%20external%20user%2C%20rather%20than%20being%20created%20as%20an%20internal%20user.%20We%20can%20see%20the%20pending%20export%20with%20the%20temporary%20DN%20and%20id%2C%20the%20GALSync%20attributes%20we%20wired%20up%2C%20and%20our%20constant%20userType%20of%20Guest.%20This%20test%20user%20has%20an%20OnMicrosoft.com%20mail%20address%20in%20the%20partner%20tenant%20as%20I%20have%20not%20added%20a%20custom%20domain%20to%20that%20tenant.%20The%20actual%20mail%20value%20is%20ultimately%20immaterial%20so%20long%20as%20it%20doesn%E2%80%99t%20already%20belong%20to%20the%20destination%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERun%20the%20Export%2C%20followed%20by%20a%20confirming%20Delta%20Import.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantConfirmingImport.png%22%20style%3D%22width%3A%20690px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283212i44543072F9CCF8AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantConfirmingImport.png%22%20alt%3D%22HomeTenantConfirmingImport.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20see%20that%20the%20user%20got%20successfully%20invited%2C%20got%20its%20real%20DN%20and%20id%20and%20has%20all%20the%20attributes%20we%20set.%20Notice%20the%20UPN%20got%20automatically%20set%20by%20AAD%20in%20the%20expected%20format%20of%20mail%23EXT%23%40tenant.%20It%20also%20was%20given%20a%20default%20setting%20of%20showInAddressList%20%3D%20false.%20By%20default%2C%20invited%20external%20users%20are%20hidden%20from%20the%20GAL.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EComplete%20a%20second%20delta%20sync%20cycle%20(Delta%20Import%2C%20Delta%20Sync%2C%20Export)%20and%20showInAddressList%20should%20get%20set%20to%20its%20synced%20value.%20For%20this%20example%20user%2C%20that%20would%20be%20a%20null%20value.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantPendingExport2.png%22%20style%3D%22width%3A%20690px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283213iD7497218B2D527F5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantPendingExport2.png%22%20alt%3D%22HomeTenantPendingExport2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20exporting%20the%20updated%20showInAddressList%20value%2C%20we%20can%20confirm%20that%20our%20GALSync%20is%20functional.%20Log%20in%20to%20Outlook%20on%20the%20web%20in%20the%20home%20tenant%2C%20open%20the%20People%20app%20and%20select%20the%20All%20Users%20GAL.%20We%20should%20see%20our%20newly%20synced%20user%20present%20in%20the%20GAL.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HomeTenantGAL.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283214iD431048116783841%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HomeTenantGAL.png%22%20alt%3D%22HomeTenantGAL.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinally%2C%20to%20complete%20the%20deprovisioning%20aspect%20of%20the%20GALSync%2C%20configure%20the%20Object%20Deletion%20Rule%20for%20the%20person%20object%20class%20to%20delete%20the%20metaverse%20object%20when%20the%20partner%20tenant%20connector%20is%20disconnected%2C%20and%20set%20the%20MA's%20Deprovisioning%20action%20to%20Stage%20a%20delete.%20This%20way%2C%20a%20deletion%20of%20the%20user%20from%20the%20partner%20tenant%20will%20cascade%20a%20delete%20of%20the%20external%20B2B%20user%20to%20our%20home%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%E2%80%99s%20the%20end%20of%20the%20setup%20for%20GALSync%20from%20a%20single%20source%20to%20a%20single%20destination%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20I%20alluded%20to%20at%20the%20beginning%2C%20more%20complex%20setups%20are%20possible.%20Consider%20a%20bi-directional%20GALSync%20where%20the%20partner%20tenant%20also%20needs%20the%20users%20from%20our%20home%20tenant.%20One%20way%20to%20keep%20the%20architecture%20simple%20is%20to%20maintain%20one%20MIM%20instance%20per%20tenant%3B%20we%20simply%20duplicate%20this%20setup%20in%20the%20opposite%20direction.%20This%20is%20identical%20to%20the%20AADC%20architecture%20where%20one%20AADC%20is%20needed%20for%20each%20tenant.%20It%20allows%20the%20provisioning%20code%20to%20know%20the%20tenant%20for%20which%20it%20is%20responsible%2C%20cleanly%20separates%20inbound%20from%20outbound%20flows%20and%20causes%20no%20precedence%20problems.%20It%20also%20allows%20the%20partner%20to%20control%20the%20app%20registration%20which%20possesses%20write%20access%20into%20their%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20consider%20a%20full-mesh%20setup%20where%20the%20tenants%20are%20all%20peers%20in%20one%20org%20that%20decided%20to%20segment%20their%20tenants%20for%20some%20reason.%20We%20could%20design%20a%20single%20MIM%20solution%20that%20manages%20every%20tenant.%20We%20could%20do%20two%20connectors%20to%20each%20tenant%20to%20allow%20us%20to%20separate%20internal%20user%20from%20external%20and%20continue%20to%20manage%20the%20flows%20separately.%20We%E2%80%99d%20only%20have%20to%20prevent%20same-tenant%20provisioning%20in%20the%20provisioning%20code.%20I%20could%20also%20see%20a%20solution%20that%20uses%20only%20one%20connector%20to%20each%20tenant.%20We%20could%20come%20up%20with%20a%20mechanism%20to%20track%20authority%20of%20address%20spaces%2C%20so%20we%20know%20which%20source%20tenant%20is%20responsible%20for%20each%20user%20and%20use%20that%20knowledge%20to%20then%20create%20the%20external%20B2B%20users%20in%20the%20other%20tenants.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20larger%20deployments%20where%20we%20might%20have%20concern%20about%20the%20number%20of%20disconnectors%20and%20corresponding%20delta%20sync%20times%2C%20there%20are%20a%20few%20advanced%20techniques%20we%20could%20implement%20to%20alleviate%20that%20concern.%20We%20could%20project%20and%20terminate%20objects%20in%20the%20metaverse%20instead%20of%20keeping%20them%20as%20disconnectors.%20Or%20we%20could%20replace%20the%20Graph%20Connector%20with%20a%20PowerShell%20Connector%20and%20take%20care%20of%20all%20the%20Graph%20logic%20ourselves%2C%20avoiding%20the%20scenarios%20where%20the%20Graph%20Connector%20has%20limitations.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHopefully%2C%20this%20has%20shed%20some%20light%20on%20considerations%20for%20a%20modern%20GALSync%20solution.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20spending%20a%20little%20bit%20of%20your%20time%20with%20me.%3C%2FP%3E%0A%3CP%3E-Dave%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDisclaimer%3A%20The%20sample%20scripts%20are%20not%20supported%20under%20any%20Microsoft%20standard%20support%20program%20or%20service.%20The%20sample%20scripts%20are%20provided%20AS%20IS%20without%20warranty%20of%20any%20kind.%20Microsoft%20further%20disclaims%20all%20implied%20warranties%20including%2C%20without%20limitation%2C%20any%20implied%20warranties%20of%20merchantability%20or%20of%20fitness%20for%20a%20particular%20purpose.%20The%20entire%20risk%20arising%20out%20of%20the%20use%20or%20performance%20of%20the%20sample%20scripts%20and%20documentation%20remains%20with%20you.%20In%20no%20event%20shall%20Microsoft%2C%20its%20authors%2C%20or%20anyone%20else%20involved%20in%20the%20creation%2C%20production%2C%20or%20delivery%20of%20the%20scripts%20be%20liable%20for%20any%20damages%20whatsoever%20(including%2C%20without%20limitation%2C%20damages%20for%20loss%20of%20business%20profits%2C%20business%20interruption%2C%20loss%20of%20business%20information%2C%20or%20other%20pecuniary%20loss)%20arising%20out%20of%20the%20use%20of%20or%20inability%20to%20use%20the%20sample%20scripts%20or%20documentation%2C%20even%20if%20Microsoft%20has%20been%20advised%20of%20the%20possibility%20of%20such%20damages.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2381682%22%20slang%3D%22en-US%22%3E%3CP%3EOver%20the%20past%20year%20I%E2%80%99ve%20seen%20an%20uptick%20in%20requests%20from%20customers%20looking%20to%20modernize%20their%20GALSync%20solution.%20Either%20they%E2%80%99re%20wanting%20to%20control%20use%20of%20SharePoint%20and%20Teams%20B2B%20capabilities%20or%20looking%20to%20enable%20a%20GALSync%20with%20a%20cloud-only%20organization.%20And%20they%E2%80%99re%20asking%20for%20assistance%20and%20guidance%20that%20I%20hope%20to%20provide%20today.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2381682%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDavidLoder%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎May 26 2021 07:45 AM
Updated by: