20.6 Set-DRARemoteMailbox

Synopsis

Updates properties of a remote mailbox specified by the Identifier parameter.

Syntax

Set-DRARemoteMailbox -Domain <String> [-AcceptMessagesOnlyFrom <String[]>] [-AcceptMessagesOnlyFromDLMembers <String[]>] [-Alias <String>] [-ArchiveName <String>] [-DisplayName <String>] [-CustomAttribute1 <String>] [-CustomAttribute2 <String>] [-CustomAttribute3 <String>] [-CustomAttribute4 <String>] [-CustomAttribute5 <String> [-CustomAttribute6 <String>] [-CustomAttribute7 <String>] [-CustomAttribute8 <String>] [-CustomAttribute9 <String>] [-CustomAttribute10 <String>] [-CustomAttribute11 <String>] [-CustomAttribute12 <String>] [-CustomAttribute13 <String>] [-CustomAttribute14 <String>] [-CustomAttribute15 <String>] [-EmailAddresses <String>] [-ExtensionCustomAttribute1 <String[]>] [-ExtensionCustomAttribute2 <String[]>] [-ExtensionCustomAttribute3 <String[]>] [-ExtensionCustomAttribute4 <String[]>] [-ExtensionCustomAttribute5 <String[]>] [-GrantSendOnBehalfTo <String[]>] [-HiddenFromAddressListsEnabled <Boolean>] [-MailTip <String>] [-Name <String>] [-RejectMessagesFrom <String[]>] [-RejectMessagesFromDLMembers <String[]>] [-RemoteRoutingAddress <String>] [-RequireSenderAuthenticationEnabled <Boolean>] [-ResetPasswordOnNextLogon <Boolean>] [-SamAccountName <String>] [-UserPrincipalName <String>] [-Properties <Hashtable>] [-Replace <Hashtable>] [-Add <Hashtable>] [-Remove <Hashtable>] [-Clear <String[]>] -Identifier <String> [-DRARestServer <String>] [-DRARestPort <Int32>] [-IgnoreCertificateErrors <SwitchParameter>] [-Force <SwitchParameter>] [-Timeout <Int32>] [<CommonParameters>]

Description

Use the Set-RemoteMailbox cmdlet to:

  • Update properties of an on-premises user account with an associated mailbox in the cloud-based service. The requesting user must have the Modify User Properties power for each property sent in the request.

  • Update properties of an on-premises object with an associated shared mailbox in the cloud-based service. The requesting user must have Modify Shared Mailbox Properties power for each property sent in the request.

Updating the properties of the cloud-based mailbox is not immediate and depends on the directory synchronization schedule. However, because the following properties are updated in both Exchange Online and on-premises Exchange, updating them is independent of the directory synchronization schedule: MailNickname, MailTip, QuotaProhibitSendReceive, QuotaProhibitSendOnly, QuotaIssueWarning, QuotaUseMBStoreDefaults, AcceptMessagesFrom, RequireAuthenticationToSendTo, MaximumRecipients, IncomingEmailSize, OutgoingEmailSize, and RejectMessagesFrom

Parameters

Attribute / Description

Parameters / Values

Required

Position

Default Value

Accept Pipeline input?

Accept wildcard characters?

AcceptMessagesOnlyFrom [<String>]

List of users and groups that are allowed to send messages to the remote mailbox.

false

named

 

true (ByPropertyName)

false

AcceptMessagesOnlyFromDLMembers [<String>]

Distribution lists whose users are allowed to send messages to the remote mailbox.

false

named

 

true (ByPropertyName)

false

Alias [<String>]

The Exchange alias (also known as the mail nickname) for the on-premises user account.

false

named

 

true (ByPropertyName)

false

ArchiveName [<String>]

The archive mailbox name in the cloud-based service.

false

named

 

true (ByPropertyName)

false

DisplayName [<String>]

The display name of the user and the associated mailbox in the cloud-based service.

false

named

 

true (ByPropertyName)

false

CustomAttribute1 [<String>]

CustomAttribute1 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute2 [<String>]

CustomAttribute2 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute3 [<String>]

CustomAttribute3 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute4 [<String>]

CustomAttribute4 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute5 [<String>]

CustomAttribute5 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute6[<String>]

CustomAttribute6 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute7 [<String>]

CustomAttribute7 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute8 [<String>]

CustomAttribute8 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute9 [<String>]

CustomAttribute9 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute10 [<String>]

CustomAttribute10 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute11 [<String>]

CustomAttribute11 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute12 [<String>]

CustomAttribute12 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute13 [<String>]

CustomAttribute13 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute14 [<String>]

CustomAttribute14 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

CustomAttribute15 [<String>]

CustomAttribute15 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

EmailAddresses [<String>]

Proxy email addresses for the remote mailbox.

false

named

 

true (ByPropertyName)

false

ExtensionCustomAttribute1 [<String>]

ExtensionCustomAttribute1 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

ExtensionCustomAttribute2 [<String>]

ExtensionCustomAttribute2 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

ExtensionCustomAttribute3 [<String>]

ExtensionCustomAttribute3 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

ExtensionCustomAttribute4 [<String>]

ExtensionCustomAttribute4 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

ExtensionCustomAttribute5 [<String>]

ExtensionCustomAttribute5 property with custom information about the remote mailbox.

false

named

 

true (ByPropertyName)

false

GrantSendOnBehalfTo [<String>]

List of users who are allowed to send messages on behalf of the user associated with the remote mailbox.

false

named

 

true (ByPropertyName)

false

HiddenFromAddressListsEnabled [<Nullable`1>]

Indicates whether the remote mailbox is visible from other address lists.

false

named

 

true (ByPropertyName)

false

MailTip [<String>]

Custom MailTip text for the remote mailbox.

false

named

 

true (ByPropertyName)

false

Name [<String>]

The unique name of the on-premises user and the associated mailbox in the cloud-based service.

false

named

 

true (ByPropertyName)

false

RejectMessagesFrom [<String>]

List of users from whom messages will be rejected.

false

named

 

true (ByPropertyName)

false

RejectMessagesFromDLMembers [<String>]

Indicates whether to accept messages only from authenticated senders.

false

named

 

true (ByPropertyName)

false

RemoteRoutingAddress [<String>]

The SMTP address of the mailbox in the cloud-based service that the on-premises user is associated with.

  • If this parameter is not specified, and the remote routing address policy is configured, DRA generates the value for the parameter based on the policy.

  • If this parameter is specified and the remote routing address policy is also configured, DRA overrides the policy configuration and uses the specified value.

  • If this parameter is not specified and the remote routing address policy is also not configured, DRA generates an error.

false

named

 

true (ByPropertyName)

false

RequireSenderAuthenticationEnabled [<Nullable`1>]

Indicates whether to accept messages only from authenticated senders.

false

named

 

true (ByPropertyName)

false

ResetPasswordOnNextLogon [<Nullable`1>]

Indicates whether the user must change their password the next time they log on.

false

named

 

true (ByPropertyName)

false

SamAccountName [<String>]

The logon name (pre-Windows 2000) compatible with older versions of Microsoft Windows client and server operating systems

false

named

 

true (ByPropertyName)

false

UserPrincipalName [<String>]

Indicates whether the user must change their password the next time they log on.

false

named

 

true (ByPropertyName)

false

Properties <Hashtable>

A hashtable of property values. The key is the name of a defined attribute in the REST interface. For example: -Properties @{Attribute1DRADisplayName="my value"; Attribute2DRADisplayName=value}

Multiple values are specified as a comma-separated list.For example: -Properties @{Attribute1DRADisplayName=value1, value2}

If the property name contains non-alphanumeric characters it needs to be quoted.For example: -Properties @{"Attribute1-DRA-DisplayName"=value}

If the property value contains a quote it needs to be escaped with a backtick (`).For example: -Properties @{Attribute1DRADisplayName="`"sample`" value"}

false

named

 

true (ByPropertyName)

false

Replace [<Hashtable>]

A Hashtable of property values to replace the current set of values for the specified property.

The key is the name of a defined property in the REST interface. For example: -Replace @{Attribute1DRADisplayName="my value"; Attribute2DRADisplayName=value}

Multiple values are specified as a comma-separated list and will replace currently set values.For example: -Replace @{Attribute1DRADisplayName=value1, value2}

If the property name contains non-alphanumeric characters it needs to be quoted.For example: -Replace @{"Attribute1-DRA-DisplayName"=value}

If the property value contains a quote it needs to be escaped with a backtick (`).For example: -Replace @{Attribute1DRADisplayName="`"sample`" value"}

false

named

 

true (ByPropertyName)

false

Add [<Hashtable>]

A Hashtable of property values to add to the current set of values for the specified multi-valued property. The key is the name of a defined property in the REST interface.

For example: -Add @{Attribute1DRADisplayName=value; Attribute2DRADisplayName=value1, value2; ...; AttributeNDRADisplayName=value1, value2}

Multiple values are specified as a comma-separated list.For example: -Add @{Attribute1DRADisplayName=value1, value2}}

If the property name contains non-alphanumeric characters it needs to be quoted.For example: -Add @{"Attribute1-DRA-DisplayName"=value}

If the property value contains a quote it needs to be escaped with a backtick (`).For example: -Add @{Attribute1DRADisplayName="`"sample`" value"}

false

named

 

true (ByPropertyName)

false

Remove [<Hashtable>]

A Hashtable of property values to remove from the current set of values for the specified multi-valued property. The key is the name of a defined property in the REST interface.

For example: -Remove @{Attribute1DRADisplayName=value; Attribute2DRADisplayName=value1, value2; ...; AttributeNDRADisplayName=value1, value2}

Multiple values are specified as a comma-separated list and will be removed from currently set values.For example: -Remove @{Attribute1DRADisplayName=value1,value2}

If the property name contains non-alphanumeric characters it needs to be quoted.For example: -Remove @{"Attribute1-DRA-DisplayName"=value}

If the property value contains a quote it needs to be escaped with a backtick (`).For example: -Remove @{Attribute1DRADisplayName="`"sample`" value"}

false

named

 

true (ByPropertyName)

false

Clear [<String>]

An array of property names whose values will be cleared. Each name is the name of a defined property in the REST interface.

For example: -Clear "Attribute1-DRA-DisplayName"

Multiple values need to be separated by a comma.

For example: -Clear Attribute1DRADisplayName, Attribute2DRADisplayName

false

named

 

true (ByPropertyName)

false

Identifier <String>

The name or distinguished name of an existing Active Directory object.

true

named

true (ByPropertyName)

false

Domain <String>

The domain of the object in FQDN format. For example: mydomain.corp

true

named

 

true (ByPropertyName)

false

DRARestServer [<String>]

The name of the computer running the DRA Rest Service. The requested DRA operation will execute on this server. If the parameter is not specified, the value defaults to 'localhost'.

false

named

 

true (ByPropertyName

false

DRARESTPort [<Int32>]

The port where the DRA REST Service listens for requests. If the parameter is not specified, the value defaults to 8755.

false

named

8755

true (ByPropertyName

false

IgnoreCertificateErrors [<SwitchParameter>]

Allows the request to bypass any SSL certificate errors, such as the InvalidOperation error that occurs when the REST Service is bound to a self-signed certificate.

false

named

false

false

Force [<SwitchParameter>]

Suppresses any request for user input and supplies a 'yes' response. For example: -Force with a delete request will perform the delete without presenting the confirmation request to the user.

false

named

 

false

false

Timeout [<Int32>]

The number of seconds to wait before the request to the DRA REST server times out. To specify an infinite timeout, you can set this parameter to -1.

false

named

100 seconds

true (ByPropertyName)

false

<CommonParameters>

Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.

 

 

 

 

 

NOTE:For more information, type "Get-Help Set-DRARemoteMailbox -detailed". For technical information, type "Get-Help Set-DRARemoteMailbox -full".

Example 20-17 1

PS C:\>Set-DRARemoteMailbox  -Domain MyDomain.corp -Identifier "CN=USER123,OU=Accounting,DC=MyDomain,DC=corp" -Properties@{TargetAddress="hello@drainternal.in";HideFromAddressLists=$true;MailTip="testMailTip";samAccountName="hexarempte2"}

This example updates the specified properties of the on-premises user account USER123 in the domain MyDomain.corp. The identifier contains the distinguished name for the user. The following properties are updated: TargetAddress, HideFromAddressLists, MailTip, and samAccountName. Updating the properties of the cloud-based mailbox is not immediate and depends on the directory synchronization schedule.

Example 20-18 2

PS C:\>Set-DRARemoteMailbox  -Domain MyDomain.corp -Identifier  "CN=USER123,OU=Accounting,DC=MyDomain,DC=corp" -Properties@{ExtensionAttribute1="testcustom";RejectMessagesFrom="CN=101SP1RM2,DC=MyDomain,DC=corp";AcceptMessagesFromGroups="CN=101SP1Group1,DC=MyDomain,DC=corp"}

This example updates the specified properties of the on-premises user account USER123 in the domain MyDomain.corp. The identifier contains the distinguished name for the user. The following properties are updated: ExtensionAttribute1, RejectMessagesFrom, and AcceptMessagesFromGroups. Updating the properties of the cloud-based mailbox is not immediate and depends on the directory synchronization schedule.

Example 20-19 3

PS C:\>Set-DRARemoteMailbox  -Domain MyDomain.corp -Identifier "CN=USER123,OU=Accounting,DC=MyDomain,DC=corp" -RemoteRoutingAddress "hello@drainternal.in" -RejectMessagesFrom "CN=101SP1RM2,DC=MyDomain,DC=corp" -HiddenFromAddressListsEnabled $true

This example updates the specified properties of the on-premises user account USER123 in the domain MyDomain.corp. The identifier contains the distinguished name for the user. The following properties are updated: RemoteRoutingAddress, RejectMessagesFrom, and HiddenFromAddressListsEnabled. Updating the properties of the cloud-based mailbox is not immediate and depends on the directory synchronization schedule.

Example 20-20 4

PS C:\>Set-DRARemoteMailbox -Domain MyDomain.corp -Identifier "CN=SMB123,OU=Accounting,DC=MyDomain,DC=corp" -RemoteRoutingAddress "hello@drainternal.in"

This example updates the RemoteRoutingAddress property of the remote shared mailbox named SMB123 in the domain MyDomain. The identifier contains the distinguished name for the remote shared mailbox. Updating the properties of the cloud-based shared mailbox is not immediate and depends on the directory synchronization schedule.

For a list of cloud-based mailbox properties that can be managed for a remote mailbox, see Exchange Online Properties.