Exchange 2010

Defrag Exchange Database Exchange 2010

Problem:

Perform an offline Defrag for the Exchange Databases so the Free Space inside the Database gets availible on the Hard Disk

Solution:

Dismount-Database MailboxDatabase-K-O

eseutil /d MailboxDatabase-K-O.edb /t\\mgt001\e$\temp.edb (where \\MGT001 has to be a location with enough freespace).

mount-Database MailboxDatabase-K-O

Links:

http://exchangeserverpro.com/defrag-exchange-2010-mailbox-database

Delete Softdeleted mailboxes

Problem:

When moving a mailbox from a Database to another Database the original Mailbox isn’t deleted but is softdeleted. Which means the space isn’t availible for new mail.

Solution:

Delete the Softdeleted mailboxes. Use te following command to delete all softdeleted mailboxes. Get-MailboxStatistics –Database “Mailbox Database 1675289436” | Where-Object {$_.DisconnectReason –eq “Softdeleted”} | ForEach {Remove-StoreMailbox –Database $_.database –identity $_.mailboxguid –MailboxState Softdeleted}

Use this one when you recieve the following error: Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.

$Mailboxes = Get-MailboxStatistics  -Database “MailboxDatabase-A-F” $Mailboxes | where {$_.DisconnectReason -eq “SoftDeleted”} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

Links:

http://www.howexchangeworks.com/2010/09/purge-disconnected-or-soft-deleted.html http://technet.microsoft.com/en-us/library/dd351136.aspx

Set mailbox language (localizedfolders)

Problem:

When creating a mailbox in Exchange 2007/2010 and you import a PST file the folders are named after the defined location, because Dutch is no standard option the localizedfolders are named after the en-US standard which means the are named inbox instead of postvak in.

Solution:

User:

Set-MailboxRegionalConfiguration -Identity “mailboxname” -Language nl-NL -LocalizeDefaultFolderName:$true.

Database:

get-mailbox -database “databasename” | set-mailboxregionalconfiguration -Language nl-NL -DateFormat “dd-MM-yyyy” -LocalizeDefaultFolderName:$true

Links:

http://technet.microsoft.com/en-us/library/dd351103(EXCHG.140).aspx

http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/e767b141-ea56-424f-8e3e-09f776c71b46/

Import PST into Mailbox Exchange

Problem:

After an export of the PST files from a Exchange environment or single users Outlook, you need to import the PST file into the new mailbox within Exchange.

Solution:

New-MailboxImportRequest -Mailbox “mailboxname” -FilePath “\\Servername\Share\pstname.PST

 

set the mailbox size quotas based on group membership in Exchange

Problem:

You would to set the mailbox size quotas based on group membership.

Solution:

Use the following script to set the Mailbox quota’s:

$g = (get-group BM-MBX-Unlimited).members
foreach ($m in $g) {
set-mailbox $m.distinguishedname -UseDatabaseQuotaDefaults $false -IssueWarningQuota “UNLIMITED” -ProhibitSendReceiveQuota  “UNLIMITED” -ProhibitSendQuota “UNLIMITED”
}

Save the script as .PS1 file and execute it using the Exchange Management Shell, when you want it as scheduled task use the following command to execute the script:

Exchange 2007: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”
Exchange 2010: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V14\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”
Exchange 2013: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V15\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”

Enable the Archive mailbox based on group membership Exchange

Problem:

You would like to enable the Archive mailbox based on group membership.

Solution:

Use the following script to set the Archive mailbox:

$g = (get-group SG-Archive).members
foreach ($m in $g) {
enable-mailbox $m.distinguishedname -Archive -ArchiveDatabase “Archive”
}

Save the script as .PS1 file and execute it using the Exchange Management Shell, when you want it as scheduled task use the following command to execute the script:

Exchange 2007: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”
Exchange 2010: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V14\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”
Exchange 2013: PowerShell.exe -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V15\Bin\ExShell.psc1” -Command “. ‘<path to script>\<YourScript>.ps1′”