Posts Tagged ‘database’

Hi folks,
for several times I wanted to dismount and re-mount one or more mailbox databases from an Exchange 2010 server. It’s a hard way to do this with the EMC so i  figured out the PowerShell commands to do this quick and easy.
Dismount one database:
Dismount-Database -Identity DBNAME -Confirm:$False
Dismount all databases of a server
Get-MailboxDatabase -Server SERVERNAME | Dismount-Database -Confirm:$False
Mount a single database
Dismount-Database -Identity DBNAME -Confirm:$False
Mount all databases of a server
Get-MailboxDatabase -Server SERVERNAME | Mount-Database -Confirm:$False

Cheers,

Chris

If not configured Exchange sets the standard notification schedule to monday, 4 a.m. once a week. To bulk change this, you have to edit all databases properties with the EMC or simply run the following PowerShell command with equals the GUI setting “Daily 2 a.m.” :

Get-MailboxDatabase | Set-MailboxDatabase -QuotaNotificationSchedule ‘So.02:00-So.02:15, Mo.02:00-Mo.02:15, Di.02:00-Di.02:15, Mi.02:00-Mi.02:15, Do.02:00-Do.02:15, Fr.02:00-Fr.02:15, Sa.02:00-Sa.02:15’

To check this settings for all DBs run the following command:

Get-MailboxDatabase | fl Name, QuotaNotificationSchedule

Regards,

Chris

If you run a multi-site DAG over subnets, it could happen, that you have anomalous database switchovers within your DAG. In the event log is triggered, that the FailoverCluster service has lost its heartbeat.

This happens because of the WAN connections latency. You could avoid this behaviour with the cluster.exe command:

cluster /prop SameSubnetDelay=2000:DWORD
cluster /prop CrossSubnetDelay=4000:DWORD
cluster /prop CrossSubnetThreshold=10:DWORD
cluster /prop SameSubnetThreshold=10:DWORD

Read this TechNet article for futher details.

Cheers,

Chris

By default the Exchange 2010 DAG replication port is set to 64327 TCP.

You can change the port with the following command:

Set-DatabaseAvailabilityGroup -Identity YOURDAG -ReplicationPort YOURPORT

Choose a valid value from 1 to 65535 and keep the firewall setup in mind.

Cheers,

Chris

With this script you can get a quick overview over your DB’s replication health, queue length and status.

Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus -ConnectionStatus | Sort-Object -Property name,status | ft

Cheers,

Chris

With this PowerShell command you get an overview of database sizes, last full backups and active servers.

(get-mailboxdatabase -status) | foreach-object {write-host $_Server $_.Name $_.lastfullbackup $_.databasesize}

Cheers,

Chris