Archive for the ‘MBX’ Category

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

Today I’ll post my favourite way to move user and mailbox objects across forrests.
  1. Prerequisite: Transitive AD trust, migration server running ADMT
  2. Migrate the user object with ADMT
  3. Mail enable migrated users with PowerShell

    Enable-MailUser -Identity user -ExternalEmailAddress user@domain.com

  4. Collect both domains’ credentials

    $LocalCredentials = GetCredential
    $RemoteCredentials = Get-Credential

  5. Prepare move with “prepare-moverequest.ps1” from Exchange servers’ scripts folder

    .\Prepare-MoveRequest.ps1 -Identity user -RemoteForestDomainController dc.olddomain.com -RemoteForestCredential $RemoteCredentials -LocalForestDomainController dc.domain.com
    -LocalForestCredential $LocalCredentials -TargetMailUserOU “OU=Users,DC=domain,DC=com” -UseLocalObject –LinkedMailUser

  6. Move mailboxes

    New-MoveRequest -identity user -RemoteLegacy -TargetDatabase MAILBOXDATABASE -RemoteGlobalCatalog dc.olddomain.com -RemoteCredential $RemoteCredentials -TargetDeliveryDomain
    domain.com

There’s a GUI for cross-forrest-moves, too:

Cross Forrest Mailbox Move GUI

Refer to this TechNet Blog article for further details.

Cheers,

Chris