Archive for the ‘MBX’ Category

An overview over mailbox sizes ordered by item size and conversion to MB

Get-Mailbox -RecipientType ‘UserMailbox’ -ResultSize unlimited | Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

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

A quick powershell command to figure out the number of mailboxes per database:

(get-mailboxdatabase) | foreach-object {write-host $_.name (get-mailbox -database $_.name).count}

Cheers,

Chris

If you want to discover where a specific user has Full Access you can use this PowerShell command:

Get-Mailbox | Get-MailboxPermission -User user@domain.com | where { ($_.AccessRights -eq “FullAccess”) }

Cheers,

Chris

In Exchange’s default the retention time for a deleted mailbox is set to 30 days. If you have to force purging a mailbox you have to set retention time to 0 days.

Set retention to 0 days:

Set-MailboxDatabase -Identity “MBX-DB001” -MailboxRetention 00.00:00:00

Cleanup Mailbox Database:

Clean-MailboxDatabase -identity “MBX-DB001

Set retention back to 30 days:

Set-MailboxDatabase -Identity “MBX-DB001” -MailboxRetention 30.00:00:00

Make sure to change the mailbox databases name to your environment.

Cheers,

Chris

For some reasons it is necessarry to enable circular logging on your Exchange databases.
This reasons could be moving many or large mailboxes or perhaps a broken backup which causes the logfile partition to be stuffed with logfiles.

However, you can enable circular logging via Exchange Management Console (EMC) or via PowerShell. With PowerShell you can set it for all databases at once.

Get-Mailboxdatabase | Set-MailboxDatabase -CircularloggingEnabled:$true

I would strongly suggest enabling circular logging should be the last option. After you solve your issue you should immidiately disable circular logging.

Get-Mailboxdatabase | Set-MailboxDatabase -CircularloggingEnabled:$false

Cheers,

Chris