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

Set ExchangeGuid for user remote mailbox

The script updates ExchangeGuid of a user remote mailbox with the GUID of the mailbox in Exchange Online. To run the script, use a custom command, business rule or scheduled task configured for the User object type.

Edit Remove
    # Get the object ID in Microsoft 365
    $objectId = [Guid]$Context.TargetObject.Get("adm-O365ObjectId")
    return # The user doesn't have a Microsoft 365 account

# Connect to Exchange Online

# Get mailbox
$mailbox = Get-Mailbox $objectId.ToString()

# Update ExchangeGuid
$Context.TargetObject.Put("msExchMailboxGuid", $mailbox.ExchangeGuid.ToByteArray())

Comments 0
Leave a comment

Got questions?

Support Questions & Answers