US English (US)
GB English (UK)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Create ticket
English (US)
US English (US)
GB English (UK)
  • Home
  • Complex Expressions

Match by left part + target domain

Written by Conrad Murray

Updated at October 27th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
  • FAQs
  • API Documentation
  • Integrations
  • Migration Agent
  • Directory Synchronisation
  • Remote DC agent
  • Remote Password Sync Agent
  • Install and Configure
  • Support
  • Complex Expressions
+ More

There could be a situation pre-cutover of a tenant where you will be taking over the domains, but you need to match the users in advance.  The users may have been created in the target with the *.onmicrosoft.com value as the right part.  So you could have a user like:

SOURCE

DisplayName: Conrad Murray

mail conrad.murray@tailspintoys.com 

UserPrincipalName conrad.murray@tailspintoys.com 

TARGET

DisplayName: Conrad Murray

mail conrad.murray@pspcontoso.onmicrosoft.com 

UserPrincipalName  conrad.murray@pspcontoso.onmicrosoft.com 

We will take over the domain name tailspintoys.com during the cutover, but for now we need these two users to match so we can create a translation table for the Workstation Migration Agent.

We can create a DirSync profile that matches user based on the left part of the mail attribute.  We need to create a Complex Expression first like this:

IF Mail is not null, THEN mail.Split('@')[0] + “targetdomain.com”

So this equates to reading in conrad.murray@tailspintoys.com as:

mail.Split('@')[0] = conrad.murray + “@pspcontoso.onmicrosoft.com” 

and looking for a match in the target tenant on that value.

In your Sync Profile do this:

search left

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • "Is not null" and "is not empty" not working as expected.
  • Requirements validation on the PowerSyncPro Server
  • Add Users as Local Administrators to Entra Joined Devices

Subscribe to Newsletter

Drop your email in the box below to sign up. We promise to keep our updates relevant and useful – and we’ll never share your details.

PowerSyncPro is the ultimate product for easing the pain and frustration during mergers, acquisitions, divestitures, and consolidations.

Terms & Conditions

  • FAQs
  • Privacy Policy
  • Cookies
  • Anti Slavery Notice

PowerSyncPro

  • Case Studies
  • Contact sales
  • Meet the Team
  • EULA

Get Connected

Room 73, Wrest House, Wrest Park, Silsoe, Bedford, England, MK45 4HR
info@powersyncpro.com

Twitter Youtube Linkedin

Knowledge Base Software powered by Helpjuice

Expand