Hybrid exchange email provisioning/enabling policy

:bangbang: Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.

Please consider addressing the following when creating your topic:

  • What have you tried? We have hybrid exchange in place and run AD after-create rule and powershell script to provision mailbox and enable policy. Mailbox is getting created but Enabling Policy is failing intermittent. We have to go and check the following box manually to enable policy. The issue is with AD propagation timing. Exchange can see the user, but it still treats the object as a plain AD user that cannot be mailbox-enabled yet. This is due to Exchange using a different domain controller than the one SailPoint just wrote to.We have tried adding Sleep-time to wait but did not help. Has anyone faced similar issue? Any suggestion is appreciated.

  • What errors did you face (share screenshots)?

  • Share the details of your efforts (code / search query, workflow json etc.)?

    email prov script.txt (4.9 KB)

  • What is the result you are getting and what were you expecting?

    Expected result - to enable Email policy - firstname.lastname@domain.com
    Result we are getting - userID@domain.onmicrosoft.com

Hi @akamolov

As a test, could you remove the update-recipient and the first set-remotemailbox commands from your script. My thinking is that the update-recipient is removing the default policy flag and then you can’t add it back with the set-remotemailbox.

Hey Jeremy,

Thanks for your response. If I remove first set-remotemailbox, where emailbox get set? The second set-remotemailbox command is removing the address policy. See screenshot below. Thanks

Hi @akamolov You’ve got a sleep in there before that one. I haven’t got time to explain exactly whats going on here, but if you can test and it’s successful, I’ll give you an explanation (maybe tomorrow).

Hello @akamolov ,

As per my understanding, Email policy was not being applied due to a conflicting configuration. This has been corrected and now you can get the email fomat as firstname.lastname@domain.com

Please find an attachment and try to use and confirm me if its working fine.

Thanks

email_prov_script_new.txt (6.7 KB)

Hi @akamolov Some notes:

Your error message indicates that an Exchange cmdlet was run on an object for which it was not intended. Your error states that it was run on a User object, so the cmdlet generating the error is expecting an Exchange-type User object. enable-remoteMailbox expects a User object, so it is not that one causing the error. Looking at the order of events we can therefore determine that it was the first set-RemoteMailbox that failed. This makes sense because it is run directly after the enable-RemoteMailbox, the cmdlet that converts the User object into a Remote Mailbox Enabled User object (by updating AD attributes msExchRemoteRecipientType and msExchRecipientTypeDetails), so it may well not have completed before the set-RemoteMailbox is run.

This set-RemoteMailbox command is being used to add the object into the Address Policy, but why is it needed?

The presence (or not) of the tick box for automatically updating email addresses is based on the AD Attribute msExchPoliciesExcluded. If the flag is not set, that means that the AD Attribute contains a reserved GUID to indicate all policies are excluded. Any Address Policies that have been applied are included in the msExchPoliciesIncluded AD Attribute.

Your error scenario indicates that msExchPoliciesExcluded includes the reserved GUID, so, how did it get there?

Assuming that you didn’t set it in the Provisioning Policy, the only command that could have added that GUID to the AD Attribute is the update-Recipient cmdlet. This cmdlet only applies to Exchange type recipients. A Remote Mailbox Enabled User is not an Exchange type recipient to on-prem Exchange. This command is therefore not needed.

Hopefully that helps explain my thinking.

PS, did you test it and did it work?

This recommended solution resulted in timeout error

I’m working on your suggested implementation. Will keep you posted

Hey Jeremy,

Removing those two lines didn’t work. here is the logs. please advise.

Hi @akamolov That error in the script appears to have been generated before my suggested changes.

Hi @akamolov, you may need to wait a bit longer before setting the policy. Ten minutes may be needed before Exchange/EXO are ready.

I recommend getting out of Exchange hybrid mode as soon as you can.

Hi @paul_hilchey that’s not actually true. The Exchange cmdlets only talk to AD for remote mailbox settings.