Script Repository

Check whether user has mailbox in Exchange Online

March 17, 2021

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
$Context.ConditionIsMet = $Context.TargetObject.RecipientType -eq "ADM_EXCHANGERECIPIENTTYPE_MAILBOXENABLED" -and `
    $Context.TargetObject.RecipientLocation -eq "ADM_EXCHANGERECIPIENTLOCATION_OFFICE365"

Comments ( 0 )
No results found.
Leave a comment