Microsoft Windows Server 2008 R2 and Exchange 2010

Windows Server 2008 R2 builds on the award-winning foundation of Windows Server 2008, expanding existing technology and adding new features to enable IT professionals to increase the reliability and flexibility of their server infrastructures. New virtualization tools, Web resources, management enhancements, and exciting Windows 7 integration help save time, reduce costs, and provide a platform for a dynamic and efficiently managed data center. Powerful tools such as Internet Information Services (IIS) version 7.5, updated Server Manager and Hyper-V platforms and Windows PowerShell version 2.0 combine to give customers greater control, increased efficiency and the ability to react to front-line business needs faster than ever before......

Tuesday, January 10, 2012

Useful Power Shell Command in Exchange 2010


Find Which Exchange 2010 CAS Server a Client Connects To
Get-LogonStatistics -Server BLEXCHMBX01 |ft username, clientname, clientversion
(clientname gives you the CAS)

or for a user:
Get-LogonStatistics -Identity yfaruqe | Sort-Object "LastAccessTime" |  ft  username, clientname, *last*

Use the Shell to update a mailbox database copy
This example shows how to seed a copy of a database named DB1 on MBX1.
Update-MailboxDatabaseCopy -Identity DB1\MBX1
This example shows how to seed a copy of a database named DB1 on MBX1 using MBX2 as the source Mailbox server for the seed.
Update-MailboxDatabaseCopy -Identity DB1\MBX1 -SourceServer MBX2
This example shows how to seed a copy of a database named DB1 on MBX1 without seeding the content index catalog.
Update-MailboxDatabaseCopy -Identity DB1\MBX1 -DatabaseOnly
This example shows how to seed the content index catalog for the copy of a database named DB1 on MBX1 without seeding the database file.
Update-MailboxDatabaseCopy -Identity DB1\MBX1 -CatalogOnly

How to Rebuild the Full-Text Index Catalog

Database Copy Automatic Activation Policy is also an option for blocking the automatic activation
Get-MailboxServer BLEXCHMBX03 | Fl Name, DatabaseCopyAutoActivationPolicy
OR
Get-MailboxDatabaseCopyStatus -Server BLEXCHMBX03 | FL DatabaseName, ActivationSuspended

Quickly View the Current Mailbox Size, Message Count, and Last Logon
Syntax
Get-MailboxStatistics -Identity 'Identity' [-Archive <$true|$false>] [-DomainContoller DomainController]
[-IncludeMoveHistory <$ true|$false>] [-IncludeMoveReport <$true|$false>]
Get-MailboxStatistics -Server 'Server' | -Database 'Database' [-DomainContoller DomainController]
Usage
Get-MailboxStatistics -Server 'corpsvr127'
Get-MailboxStatistics -Database 'Engineering Primary'


How to Find Exchange Server 2010 Mailboxes without Storage Quotas
[PS] C:\>get-mailbox | where {$_.UseDatabaseQuotaDefaults -eq $False}

Name        Alias                ServerName       ProhibitSendQuota
----       -----                ----------       -----------------
DiscoverySearchMailbox... DiscoverySearchMa... ex2              50 GB (53,687,091,200 bytes)
Carole.Malik              Carole.Malik         ex2              unlimited
Davina.Nsiah              Davina.Nsiah         ex2              5.371 GB (5,767,168,000 bytes)
Helen.Cail                Helen.Cail           ex2              4.688 GB (5,033,164,800 bytes)
Jas.Mahal                 Jas.Mahal            ex2              unlimited
Lorraine.Oza              Lorraine.Oza         ex2              unlimited
Oliver.Loffler            Oliver.Loffler       ex2              4.688 GB (5,033,164,800 bytes)

The output above shows that some mailboxes have no quotas, whereas others have custom storage quotas applied. To see the full details of the storage quotas configured on these mailboxes use the following command in the Exchange Management Shell.
[PS] C:\>get-mailbox | where {$_.UseDatabaseQuotaDefaults -eq $False} | ft name,prohibit*,issue*


However if you want to see a list of users mailbox sizes then you will need to use PowerShell.
Get-MailboxServer | Get-MailboxStatistics | select displayname,itemcount,totalitemsize | Conver
tTo-HTML | Out-File D:\Test.htm

See Mailbox Statics of a particular Database
Get-MailboxStatistics -Database 'MDB06'| select displayname,itemcount,totalitemsize

Get-MailboxStatistics -Server BLEXCHMBX02 |Sort-Object -Property TotalItemSize -Descending |Select-Object -property DisplayName,@{N="ItemCount";E={$_.ItemCount}},@{N="TotalItemSize";E={$_.TotalItemSize.value.ToMB()}},@{N="deletedItemCount";E={$_.deletedItemCount}},@{N="TotalDeletedItemSize";E={$_.TotalDeletedItemSize}},@{N="Database";E={$_.Database}} |Export-CSV -Path c:\Notice\MailboxReport.csv -NoTypeInformation

To View the statistics in MB
Get-MailboxStatistics -Database MDB06 |Sort-Object -Property TotalItemSize -Descending |Select-Object -property DisplayName,@{N="ItemCount";E={$_.ItemCount}},@{N="TotalItemSize";E={$_.TotalItemSize.value.ToMB()}},@{N="deletedItemCount";E={$_.deletedItemCount}},@{N="TotalDeletedItemSize";E={$_.TotalDeletedItemSize.value.ToMB()}},@{N="Database";E={$_.Database}} |Export-CSV -Path D:\MDB06.csv -NoTypeInformation
Check Exchange Database Size:


Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize

ServerName                              Name                                    DatabaseSize
----------                              ----                                    ------------
XXEXCHMBX01                             MDB01                                   107.4 GB (115,301,482,496 bytes)
XXEXCHMBX01                             MDB02                                   119.9 GB (128,723,779,584 bytes)
XXEXCHMBX01                             MDB03                                   115 GB (123,488,763,904 bytes)
XXEXCHMBX02                             MDB04                                   112.5 GB (120,804,409,344 bytes)
XXEXCHMBX02                             MDB05                                   103.1 GB (110,738,079,744 bytes)
XXEXCHMBX02                             MDB06                                   179.4 GB (192,610,893,824 bytes)


Exchange 2010 Find Database White Space
Get-MailboxDatabase -Status | Select-Object Server,Name,AvailableNewMailboxSpace

Server                                  Name                                    AvailableNewMailboxSpace
------                                  ----                                    ------------------------
XXEXCHMBX01                             MDB01                                   17.59 MB (18,448,384 bytes)
XXEXCHMBX01                             MDB02                                   121 MB (126,844,928 bytes)
XXEXCHMBX01                             MDB03                                   110 MB (115,343,360 bytes)
XXEXCHMBX02                             MDB04                                   44.81 MB (46,989,312 bytes)
XXEXCHMBX02                             MDB05                                   29.09 MB (30,507,008 bytes)
XXEXCHMBX02                             MDB06                                   15.86 GB (17,031,495,680 bytes)

Get-MailboxDatabase MDB06 -Status | FL AvailableNewMailboxSpace

Set Quota of Retention Item
Set-MailboxDatabase -Identity MDB03 -RecoverableItemsWarningQuota 20GB -RecoverableItemsQuota 30GB

Get Recoverable Items Folder Statistics
The Recoverable Items folder contains items deleted by Microsoft Outlook and Microsoft Office Outlook Web App users or by the Mailbox Assistant
Get-MailboxFolderStatistics -Identity "Sanjoy Saha" -FolderScope RecoverableItems | Format-List

Get-MailboxFolderStatistics -Identity "Nizar El-Assaad" -FolderScope RecoverableItems | Format-Table Name,FolderPath,ItemsInFolder,FolderAndSubfolderSize

Get-MailboxFolderStatistics -Identity "Maruf Ahmed" -FolderScope RecoverableItems | Format-Tabl
e Name,FolderPath,ItemsInFolder,FolderAndSubfolderSize

Name                          FolderPath                                    ItemsInFolder FolderAndSubfolderSize
----                          ----------                                    ------------- ----------------------
Recoverable Items             /Recoverable Items                                     2043 1.332 GB (1,430,546,505 by...
Deletions                     /Deletions                                             6619 1.315 GB (1,412,322,237 by...
Purges                        /Purges                                                   0 0 B (0 bytes)
Versions                      /Versions                                                 0 0 B (0 bytes)


To display the user's alias formatted in a table together with the user's Exchange 2010 server name and telephone extension, type:

 Get-Mailbox | Format-Table ServerName,@{e={$_.SamAccountName};Label="User Alias"},@{Expression="Extensions";Label="Telephone numbers

Sunday, January 1, 2012

Installing Update Rollups on Exchange 2010 Database Availability Group Members


It's relatively straightforward to install Microsoft Exchange Server 2010 update rollups on a server that's a member of a database availability group (DAG).

Microsoft Update offers released update rollups to Mailbox servers that are part of DAG. However, Microsoft recommends that we should download the update rollups from the Microsoft Download Center and then install them manually. When we install an update rollup on a server that's a DAG member, several services will be stopped during the installation, including all Exchange services and the Windows Cluster service.

The general process for installing update rollups on a DAG member is as follows:

  • Suspend activation for the databases on the server being updated.
  • Perform a server switchover so that all databases on the server are passive copies. During the switchover process, there will be a brief interruption in service for the mailboxes hosted on the active databases.
  • Install the update rollup.
  • Resume activation for the databases on the updated server.
  • Perform database switchovers as needed, or rebalance the DAG by using the RedistributeActiveDatabases.ps1 script.

Install a Update Rollup on a Database Availability Group Member

To update all DAG members, perform the following procedures on each DAG member, one at a time.

Suspend activation for the database copies on the server being updated

Run the following command in the Exchange Management Shell:

Get-MailboxDatabaseCopyStatus -Server <Server> | Suspend-MailboxDatabaseCopy -ActivationOnly -Confirm:$False -SuspendComment "Install update rollup for Exchange 2010"



Perform a server switchover on the server being updated

  1. In the console tree of the Exchanger Management Console (EMC), navigate to Server Configuration > Mailbox.
  2. In the result pane, select the Mailbox server you want.
  3. In the action pane, select Switchover Server.
  4. In Switchover server database copies, do one of the following:
    • Accept the default setting of Automatically choose a target server (in which case, the system automatically selects the best Mailbox server for each database being switched over), and then click OK.
    • Click Use the specified server as the target for switchover, click Browse to select a Mailbox server, and then click OK.



Install the update rollup

  1. Close all Exchange management tools.
  2. Right-click the Exchange update rollup file (.msp file) you downloaded, and then select Apply.
  3. On the Welcome page, click Next.
  4. On the License Terms page, review the license terms, select I accept the License Terms, and then click Next.
  5. On the Completion page, click Finish.

Resume activation for the databases on the updated server

Run the following command in the Shell:

Get-MailboxDatabaseCopyStatus -Server <Server> | Resume-MailboxDatabaseCopy



Perform database switchovers as needed

  1. In the console tree of the EMC, navigate to Organization Configuration > Mailbox.
  2. In the result pane, click the Database Management tab, and then click the mailbox database whose copy you want to activate.
  3. In the action pane, click Activate a Database Copy.
  4. On the Activate a Database Copy page, click Browse to select the server you updated.
  5. Select the desired setting for the automatic database mount dial setting on the selected server.
  6. Click Move to activate the selected passive copy of the database to the updated server.
  7. On the Completion page, review the following, and then click Finish to close the wizard:
    • A status of Completed indicates that the wizard completed the task successfully.
    • A status of Failed indicates that the task wasn't completed. If the task fails, review the summary for an explanation, and then click Back to make any configuration changes.