Skip to content

IAdmExchangeRemoteMailboxOps

The IAdmExchangeRemoteMailboxOps interface allows enabling and disabling remote mailboxes.

Inheritance: The IAdmExchangeRemoteMailboxOps interface inherits from the IUnknown interface.

Note

The IAdmExchangeRemoteMailboxOps interface is available on the server-side only. Thus, methods of the interface can be used only in scripts executed via Business Rules, Custom Commands, and Scheduled Tasks.

Methods

Details

HasRemoteMailbox()

Checks whether the user has a remote mailbox.

Boolean HasRemoteMailbox()

EnableRemoteMailbox()

Enables a remote mailbox for the user.

void EnableRemoteMailbox(String remoteRoutingAddress)

Parameters

The remoteRoutingAddress parameter specifies the SMTP address of the remote mailbox in Microsoft 365 (e.g. username@mycompany.mail.onmicrosoft.com). If you set the parameter to NULL an address will be generated automatically by Exchange.

Examples

The following code sample enables a remote mailbox using the $Context.TargetObject property.

$remoteRoutingAddress = "john.smith@mycompany.mail.onmicrosoft.com"

$Context.EnableRemoteMailbox($remoteRoutingAddress)

EnableRemoteMailboxEx()

Enables a remote mailbox for the user. This method extends the EnableRemoteMailbox method with the ability to specify the alias and the primary SMTP address of the mail user that represents the mailbox in your on-premises organization. Also, the method can be used to create remote mailbox archives and remote mailboxes for rooms and equipment.

void EnableRemoteMailboxEx(String remoteRoutingAddress, 
                           String alias, 
                           Boolean equipment, 
                           Boolean room, 
                           Boolean archive, 
                           String archiveName, 
                           String primarySmtpAddress)

Parameters

  • remoteRoutingAddress - Specifies the SMTP address of the remote mailbox in Microsoft 365 (e.g. username@mycompany.mail.onmicrosoft.com). If you set the parameter to NULL, an address will be generated automatically by Exchange.
  • alias - Specifies an email alias for the mailbox. An alias can contain characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %, &, ‘, , +, -, \/, =, ?, ^, _, `, {, |, } or ~. If the parameter is set to NULL*, an alias will be generated automatically.
  • equipment - When set to TRUE, the method creates an equipment mailbox.
  • room - When set to TRUE, the method creates a room mailbox.
  • archive - When set to TRUE, the method creates a mailbox archive mailbox. It can be created only if a user already has a mailbox in Exchange Online.
  • archiveName - Specifies a name for the mailbox archive. If the archive name is set to NULL, it will be generated automatically by Exchange. The parameter is taken into account only if the archive parameter is set to TRUE.
  • primarySmtpAddress - Specifies a primary SMTP address for the mail user that represents the mailbox in your on-premises Exchange organization. If it is set to NULL, the address will be generated automatically based on the default address policy of the Exchange organization.

Examples

The following code sample enables a remote mailbox using the $Context.TargetObject property.

$routingAddress = "room1@mycompany.mail.onmicrosoft.com"
$alias = "MeetingRoomOnGroundFloor"
$roomMailbox = $True

$equipmentMailbox = $False
$mailboxArchive = $False
$archiveName = $NULL

$Context.EnableRemoteMailboxEx($routingAddress, $alias, `
$equipmentMailbox, $roomMailbox, $mailboxArchive, $NULL, $NULL)

DisableRemoteMailbox()

Disables the remote mailbox of the user.

void DisableRemoteMailbox()

Requirements

Minimum required version: 2016

See also