Set-MailboxDatabase

 

Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

Use the Set-MailboxDatabase cmdlet to set the attributes of a mailbox database.

Syntax

Set-MailboxDatabase -Identity <DatabaseIdParameter> [-AllowFileRestore <$true | $false>] [-Confirm [<SwitchParameter>]] [-DeletedItemRetention <EnhancedTimeSpan>] [-DomainController <Fqdn>] [-EventHistoryRetentionPeriod <EnhancedTimeSpan>] [-IndexEnabled <$true | $false>] [-IssueWarningQuota <Unlimited>] [-JournalRecipient <RecipientIdParameter>] [-MailboxRetention <EnhancedTimeSpan>] [-MaintenanceSchedule <Schedule>] [-MountAtStartup <$true | $false>] [-Name <String>] [-OfflineAddressBook <OfflineAddressBookIdParameter>] [-ProhibitSendQuota <Unlimited>] [-ProhibitSendReceiveQuota <Unlimited>] [-PublicFolderDatabase <DatabaseIdParameter>] [-QuotaNotificationSchedule <Schedule>] [-RetainDeletedItemsUntilBackup <$true | $false>] [-WhatIf [<SwitchParameter>]]

Set-MailboxDatabase [-AllowFileRestore <$true | $false>] [-Confirm [<SwitchParameter>]] [-DeletedItemRetention <EnhancedTimeSpan>] [-DomainController <Fqdn>] [-EventHistoryRetentionPeriod <EnhancedTimeSpan>] [-IndexEnabled <$true | $false>] [-Instance <MailboxDatabase>] [-IssueWarningQuota <Unlimited>] [-JournalRecipient <RecipientIdParameter>] [-MailboxRetention <EnhancedTimeSpan>] [-MaintenanceSchedule <Schedule>] [-MountAtStartup <$true | $false>] [-Name <String>] [-OfflineAddressBook <OfflineAddressBookIdParameter>] [-ProhibitSendQuota <Unlimited>] [-ProhibitSendReceiveQuota <Unlimited>] [-PublicFolderDatabase <DatabaseIdParameter>] [-QuotaNotificationSchedule <Schedule>] [-RetainDeletedItemsUntilBackup <$true | $false>] [-WhatIf [<SwitchParameter>]]

Detailed Description

To run the Set-MailboxDatabase cmdlet, the account you use must be delegated the following:

  • Exchange Server Administrator role and local Administrators group for the target server

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The Identity parameter identifies the mailbox database for which you want to set one or more attributes. You can use the following values:

  • GUID

  • Distinguished name (DN)

  • Name of the mailbox database

  • Server name\storage group name\database name

  • Server name\database name

  • Storage group name\database name

If you do not specify the server name, the cmdlet will search for the database on the local server. If you have multiple databases with the same name, you must specify the storage group.

AllowFileRestore

Optional

System.Boolean

The AllowFileRestore parameter specifies whether to allow restoring a database from a backup. The two possible values are $true or $false. If you specify $true, the command will allow a database that does not match the database entry in the Active Directory directory service to be mounted. If you specify $false, the command will not allow a database that does not match the database entry in Active Directory to be mounted, so you will not be able to replace an existing database with a newly created database.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm parameter causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You do not have to specify a value with the Confirm parameter.

DeletedItemRetention

Optional

Microsoft.Exchange.Data.EnhancedTimeSpan

The DeletedItemRetention parameter specifies the length of time to keep deleted items. To specify a value, enter it as a time span: dd.hh:mm:ss where d = days, h = hours, m = minutes, and s = seconds. For example, to specify a 15-hour interval, enter 15:00:00. The maximum length of time to retain deleted items is 24,855 days. By default, deleted items are retained for 14 days. This attribute applies to all mailboxes in this mailbox database that do not have their own item retention attribute set.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory, include the DomainController parameter in the command.

EventHistoryRetentionPeriod

Optional

Microsoft.Exchange.Data.EnhancedTimeSpan

The EventHistoryRetentionPeriod parameter specifies the length of time to keep event data. This event data is stored in the event history table in the Exchange store. It includes information about changes to various objects in the mailbox database. You can use this parameter to prevent the event history table from becoming too large and using too much disk space. To specify a value, enter it as a time span: dd.hh:mm:ss where d = days, h = hours, m = minutes, and s = seconds. For example, to specify a 15-hour interval, enter 15:00:00.

IndexEnabled

Optional

System.Boolean

The IndexEnabled parameter specifies whether to enable Exchange Search for this mailbox database. The two possible values for this parameter are $true or $false.

Instance

Optional

Microsoft.Exchange.Data.Directory.SystemConfiguration.MailboxDatabase

The Instance parameter is typically used in scripts where an administrator or developer needs to supply values to a command. The Instance parameter is equivalent to piping the result of one command to another, but allows the script to assign values via variables rather than trying to construct a pipeline.
The Instance parameter is rarely used by administrators who type commands at a command prompt. It is included in the parameters table for developer reference.

IssueWarningQuota

Optional

Microsoft.Exchange.Data.Unlimited

The IssueWarningQuota parameter specifies the mailbox size at which a warning message is sent to the user.

This attribute applies to all mailboxes in this mailbox database that do not have their own warning quota attribute set. You must specify either an integer or "unlimited." The default value is 1.9 gigabytes (GB).

JournalRecipient

Optional

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter

The JournalRecipient parameter specifies the mailbox to which journal reports are sent.

MailboxRetention

Optional

Microsoft.Exchange.Data.EnhancedTimeSpan

The MailboxRetention parameter specifies the length of time to keep deleted mailboxes. To specify a value, enter it as a time span: dd.hh:mm:ss where d = days, h = hours, m = minutes, and s = seconds. For example, to specify a 15-hour interval, enter 15:00:00. The maximum length of time to retain mailboxes is 24,855 days. By default, deleted mailboxes are retained for 30 days. This attribute applies to all mailboxes in this mailbox database.

MaintenanceSchedule

Optional

Microsoft.Exchange.Data.Schedule

The MaintenanceSchedule parameter specifies when maintenance will be done on the mailbox database. Maintenance includes online defragmentation, removing items that have passed their retention period, removing unused indexes, and other cleanup tasks.

The format is StartDay.Hour:Minute [AM/PM]-EndDay.Hour:Minute [AM/PM]. You can use the following values for the start and end days:

  • Full name of the day

  • Abbreviated name of the day

  • Integer from 0 to 6, where 0 = Sunday

If you prefer to use a 24-hour clock, omit AM/PM. If you use AM/PM, you must include a space between the time and the AM or PM.

Formats can be mixed.

The start time and end time must be at least 15 minutes apart. Minutes will be rounded down to 0, 15, 30, or 45. If you specify more than one interval, there must be at least 15 minutes between each interval.

Examples:

  • "Sun.11:30 PM-Mon.1:30 AM"

  • 6.22:00-6.22:15 (Maintenance will run from Saturday at 10:00 PM until Saturday at 10:15 PM.)

  • "Monday.4:30 AM-Monday.5:30 AM","Wednesday.4:30 AM-Wednesday.5:30 AM" (Maintenance will run on Monday and Wednesday mornings from 4:30 until 5:30.)

  • "Sun.1:15 AM-Monday.23:00"

MountAtStartup

Optional

System.Boolean

The MountAtStartup parameter specifies whether to mount this mailbox database when the Microsoft Exchange Information Store service starts. The two possible values for this parameter are $true or $false.

Name

Optional

System.String

The Name parameter specifies the name of the mailbox database.

OfflineAddressBook

Optional

Microsoft.Exchange.Configuration.Tasks.OfflineAddressBookIdParameter

The OfflineAddressBook parameter specifies the associated address book for this mailbox database.

ProhibitSendQuota

Optional

Microsoft.Exchange.Data.Unlimited

The ProhibitSendQuota parameter specifies the mailbox size at which users associated with mailboxes in this mailbox database can no longer send messages. This attribute applies to all mailboxes in this mailbox database that do not have their own prohibit send quota attributes set.

You must specify either an integer or "unlimited."

ProhibitSendReceiveQuota

Optional

Microsoft.Exchange.Data.Unlimited

The ProhibitSendReceiveQuota parameter specifies the mailbox size at which the user associated with this mailbox can no longer send or receive messages. This attribute applies to all mailboxes in this mailbox database that do not have their own prohibit send receive quota attributes set.

You must specify either an integer or "unlimited."

PublicFolderDatabase

Optional

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The PublicFolderDatabase parameter specifies the associated public folder database for this mailbox database. You can use the following values:

  • GUID

  • Distinguished name (DN)

  • Name of the public folder database

  • Server name\storage group name\database name

  • Server name\database name

  • Storage group name\database name

QuotaNotificationSchedule

Optional

Microsoft.Exchange.Data.Schedule

The QuotaNotificationSchedule parameter specifies when quota messages are sent to mailboxes that have reached one of the quota values.

The format is StartDay.Hour:Minute [AM/PM]-EndDay.Hour:Minute [AM/PM]. You can use the following values for the start and end days:

  • Full name of the day

  • Abbreviated name of the day

  • Integer from 0 to 6, where 0 = Sunday

If you prefer to use a 24-hour clock, omit AM/PM.

Formats can be mixed.

The start time and end time must be at least 15 minutes apart. Minutes will be rounded down to 0, 15, 30, or 45. If you specify more than one interval, there must be at least 15 minutes between each interval.

Examples:

  • "Sun.11:30 PM-Mon.1:30 AM"

  • 6.22:00-6.22:15 (Notification will run from Saturday at 10:00 PM until Saturday at 10:15 PM.)

  • "Monday.4:30 AM-Monday.5:30 AM","Wednesday.4:30 AM-Wednesday.5:30 AM" (Notification will run on Monday and Wednesday mornings from 4:30 until 5:30.)

  • "Sun.1:15 AM-Monday.23:00"

RetainDeletedItemsUntilBackup

Optional

System.Boolean

The RetainDeletedItemsUntilBackup parameter specifies whether to retain delete items until the next backup occurs. The two possible values for this parameter are $true or $false.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf parameter instructs the command to simulate the actions that it would take on the object. By using the WhatIf parameter, you can view what changes would occur without having to apply any of those changes. You do not have to specify a value with the WhatIf parameter.

Input Types

Return Types

Errors

Error Description

 

Exceptions

Exceptions Description

 

Example

The following example shows how to set the length of time that deleted items are retained. If a particular mailbox has its own item retention set, that value will be used instead of this value set on the mailbox database.

Set-MailboxDatabase "Mailbox Database01" -DeletedItemRetention 7.00:00:00