Monday, July 11, 2011

Exchange 2010-Create a Mailbox Size Report

Here's my contribution. I wrote this script to include some additional information in the Mailbox size report:

Get-User -ResultSize Unlimited | Where {$_.RecipientType -eq "UserMailbox"} | Select DisplayName, Company, City | foreach {
$MailboxInfo = Get-Mailbox -identity $_.displayName
$MailboxStat = Get-MailboxStatistics -identity $_.displayName
Add-Member -InputObject $_ noteProperty UseDefault $MailboxInfo.UseDatabaseQuotaDefaults
Add-Member -InputObject $_ noteProperty WarningQuota $MailboxInfo.IssueWarningQuota
Add-Member -InputObject $_ noteProperty SendQuota $MailboxInfo.ProhibitSendQuota
Add-Member -InputObject $_ noteProperty SendRecieveQutoa $MailboxInfo.ProhibitSendReceiveQuota
Add-Member -InputObject $_ noteProperty MBAlias $MailboxInfo.Alias
Add-Member -InputObject $_ noteProperty QuotaStatus $MailboxStat.StorageLimitStatus
Add-Member -InputObject $_ noteProperty TotalItems $MailboxStat.ItemCount
Add-Member -InputObject $_ noteProperty TotalSizeMB $MailboxStat.TotalItemSize.Value.ToMB()
Add-Member -InputObject $_ noteProperty DeleteItems $MailboxStat.DeletedItemCount
Add-Member -InputObject $_ noteProperty DeletedSizeMB $MailboxStat.TotalDeletedItemSize.Value.ToMB() -PassThru
} | Export-Csv -Path D:\MailboxSize.csv


---------------------------------
Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount

This script will list all mailboxes starting with the largest then Descending down the page it will also give you number of items in each mailbox and list size in MB.
You can adjust the Size metric given by changing {$_.TotalItemSize.Value.ToMB()} to ether {$_.TotalItemSize.Value.ToKB()} or if you are unlucky {$_.TotalItemSize.Value.ToGB()}. Also if you would like to change the listing at the top of the report make a similar change to the "TotalItemSize(MB)" expression.

---------------------------------
When I run below command in Exchange Management Shell for Database name “Mailbox Database”, it gives similar output to ESM 2003. Only difference is it shows size in Bytes instead of KB.
Get-MailboxStatistics -database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Format-Table
 image
Now if I want to export this into CSV the I need to run below command.
Get-MailboxStatistics -Database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV test.csv
image
Now lets say I want size in MB then I  need to run below command.
Get-MailboxStatistics -Database “Mailbox Database” | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime
image

If I want to sort this report by Mailbox Size then I need to run below command.
Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime 
image
  • In these examples we got reports for database “Mailbox Database” in same way we can get it for whole server with below command.
      Get-MailboxStatistics -Server MailboxServer01
  • Here we added DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime columns in our report and in same way we can add below list of columns …
AssociatedItemCount
Database
DatabaseName
DeletedItemCount
DisconnectDate
DisplayName
Identity
ItemCount
LastLoggedOnUserAccount
LastLogoffTime
LastLogonTime
LegacyDN
MailboxGuid
ServerName
StorageGroupName
StorageLimitStatus
TotalDeletedItemSize
TotalItemSize

Thursday, June 30, 2011

Rapid transition guide from Exchange 2003 to Exchange 2010

Rapid transition guide from Exchange 2003 to Exchange 2010

Milind Naphade 1 2 Table of Contents Introduction........................................................................................................................................................ 4
Check Existing Topologies ................................................................................................................................... 5
Network Prerequisites: ..................................................................................................................................... 5
Active Directory Servers: ............................................................................................................................... 5
Exchange 2003 Servers: ............................................................................................................................... 6
Prepare for Exchange 2010 Servers ........................................................................................................................ 6
Preparing Hardware......................................................................................................................................... 6
Preparing Software to install Exchange Server 2010 ............................................................................................ 7
Installing Exchange Server 2010 in Co-Existence with Exchange Server 2003 ........................................................... 9
Preparing Active Directory ................................................................................................................................ 9
Installing Exchange Server 2010 ...................................................................................................................... 10
Verifying the Exchange Server 2010 Installation ................................................................................................ 12
Enter the Product Key .................................................................................................................................... 12
Configure Exchange Server 2010 ......................................................................................................................... 13
Register Filter Pack IFilters with Exchange 2010 ................................................................................................ 13
Configure Hub Transport Server Role Settings ................................................................................................... 13
Configure Receive Connector ........................................................................................................................ 13
Configure Send Connector ............................................................................................................................ 14
Configure Firewall Rules to allow outbound/inbound SMTP communication from HT server. ............................. 16
Configure Client Access Server Role .................................................................................................................. 17
Configure Outlook Web App ......................................................................................................................... 17
Configure Exchange Control Panel (ECP) ....................................................................................................... 18
Configure Microsoft Exchange ActiveSync ...................................................................................................... 20
Configure Offline Address Book Distribution ................................................................................................... 21
Configure Outlook Anywhere ........................................................................................................................ 22
Request, Download and Configure a SAN Certificate ...................................................................................... 24
Configure Mailbox Server Role .......................................................................................................................... 25
Move the Exchange 2010 Database and Logs Locations: ................................................................................ 25
Restart Services ............................................................................................................................................ 26
Restart IIS ................................................................................................................................................ 26
Restart Exchange Information Store Service .................................................................................................. 26
Moving Settings and Data to Exchange 2010 ........................................................................................................ 27
Move Data .................................................................................................................................................... 27
Move Mailboxes ......................................................................................................................................... 27
Move Public Folders ................................................................................................................................... 29
Move Organization Settings .............................................................................................................................. 30
Move OAB Generation Server ....................................................................................................................... 30
Upgrade Address Lists ................................................................................................................................ 31
3 Upgrade Email Address Policies .................................................................................................................... 32
Removing Exchange Server 2003 ......................................................................................................................... 32
Removing Mailbox and Public Folder Databases ................................................................................................. 32
Remove Routing Group Connector .................................................................................................................... 33
Remove Recipient Update Service .................................................................................................................... 33
Uninstall Exchange Server 2003 ....................................................................................................................... 33
4 Introduction This guide will walk you through the most important considerations and steps that you need to perform before, during, and after the deployment of Exchange 2010 server.
This guide is written for the IT administrators of an existing Exchange 2003 organization which contains small to medium scale deployments.
This guide mainly focuses on a typical transition of Exchange 2003 to Exchange 2010 environment which includes the transition of Exchange 2003 backend and front end servers to Exchange 2010 mailbox server role, client access server role and hub transport server role installed using the typical installation method. This guide does not discuss about implementation of Unified Messaging Server Role.
It is presumed that the readers of this guide has good understanding of Exchange 2003 and Exchange 2010 functionality or have hands on experience on both. If you are new to Exchange Server 2010; it is highly recommended that you stop by and read the recommended articles in
To keep this document simple and compact we have used command line mode to setup Exchange Server 2010.
Recommended Articles section of this guide. To prevent complexities while following the steps shown in this guide, configuration for complex exchange deployments have intentionally been omitted. 5 Check Existing Topologies To avoid any installation hassles or a run through a series or errors during installation; it is highly recommended to perform an assessment of your existing AD and Exchange topology even before you start planning for Exchange 2010 servers. Exchange 2010 is packed with many new features and they require some additional resources on your existing network which includes little more additional software as well as the some new hardware.
A small but very important point that you should know is Exchange 2010 cannot be installed in co-existence with Exchange 2000 servers. To upgrade to Exchange 2010 you must move entire of your Exchange 2000 organization to Exchange Server 2003 organization
Network Prerequisites: Active Directory Servers:
Table 1: Active Directory Prerequisites

Component Requirement
Schema master The schema master must be running any of the following: Windows Server 2003 Standard Edition with Service Pack 1 (SP1) or later (32-bit or 64-bit) Windows Server 2003 Enterprise Edition with SP1 or later (32-bit or 64-bit) Windows Server 2008 Standard or Enterprise (32-bit or 64-bit) Windows Server 2008 R2 Standard or Enterprise
Global catalog server Each Active Directory site where you plan to install Exchange 2010, you must have at least one global catalog server running any of the following: Windows Server 2003 Standard Edition with SP1 or later (32-bit or 64-bit) Windows Server 2003 Enterprise Edition with SP1 or later (32-bit or 64-bit) Windows Server 2008 Standard or Enterprise (32-bit or 64-bit) Windows Server 2008 R2 Standard or Enterprise
Domain controller Each Active Directory site where you plan to install Exchange 2010, you must have at least one writeable domain controller running any of the following: Windows Server 2003 Standard Edition with SP1 or later (32-bit or 64-bit) Windows Server 2003 Enterprise Edition with SP1 or later (32-bit or 64-bit) Windows Server 2008 Standard or Enterprise (32-bit or 64-bit) Windows Server 2008 R2 Standard or Enterprise
Things that you need before and after you move to Exchange Server 2010

Exchange 2010-Clean Mailbox Database

In Exchange 2007, if a recently-disabled mailbox does not appear in the Disconnected Mailbox menu in EMC (if you wanted to reconnect it to a different user, for instance), simply run one of the following commands in Powershell:
Clean-MailboxDatabase \servername\SGName\Store
Cleans Database of the individual store

Get-Mailboxdatabase | Clean-MailboxDatabase
Cleans all databases in the Organization

Get-Mailboxdatabase | Where{ $_.Server –eq “<servername>”}| clean-MailboxDatabase
Cleans all databases in the specific store
if there is only one db, then just Get-MailboxDatabase | Clean-MailboxDatabase


Get-Mailboxdatabase | Where{ $_.Name –eq “<DatabaseName>”}| clean-MailboxDatabase
Cleans all databases that match the specific name given in “Databasename”