We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script Repository

Check whether user has mailbox in Exchange Online

January 18, 2023 Views: 5130

The script can be used in business rules, custom commands and scheduled tasks to check whether the user on which it is executed has a mailbox in Exchange Online. To use the script in your rule, command or task, add the If PowerShell script returns true condition that runs the script.

Edit Remove
PowerShell
$Context.ConditionIsMet = $Context.TargetObject.RecipientType -eq "ADM_EXCHANGERECIPIENTTYPE_MAILBOXENABLED" -and `
    $Context.TargetObject.RecipientLocation -eq "ADM_EXCHANGERECIPIENTLOCATION_EXCHANGEONLINE"
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers