Get Mailbox Folder Statistics that includes Dates of the Oldest and Newest Mail Items

Get-MailboxFolderStatistics rdanie21 -IncludeOldestAndNewestItems  | Sort name | Select Name, Folderpath, ItemsInFolder, FolderSize, OldestItemReceivedDate You want to list the mailbox folders for a mailbox and include the date of the oldest item within that folder.

Run the following:

Get-MailboxFolderStatistics mailbox -IncludeOldestAndNewestItems  | Sort name | Select Name, Folderpath, ItemsInFolder, FolderSize, OldestItemReceivedDate

Perform IIS reset on multiple servers at once.

Perform IIS reset on multiple servers at once. Displays status after reset. 
#Specify servers in an array variable, Make sure you change the where statement.
[array]$servers = get-exchangeserver | where {$_.identity -like “esg*” -and $_.AdminDisplayVersion -match “version 15.0*”}

#Step through each server in the array and perform an IISRESET
#Also show IIS service status after the reset has completed

foreach ($server in $servers)
{
    Write-Host “Restarting IIS on server $server…”
    IISRESET $server
    Write-Host “IIS status for server $server”
    IISRESET $server /status
}
Write-Host “IIS has been restarted on all servers”
OR

#Specify servers in an array variable
[array]$servers = “Server1″,”Server2″,”Server3″,”Server4”
#Step through each server in the array and perform an IISRESET
#Also show IIS service status after the reset has completed
foreach ($server in $servers)
{
    Write-Host “Restarting IIS on server $server…”
    IISRESET $server
    Write-Host “IIS status for server $server”
    IISRESET $server /status
}
Write-Host IIS has been restarted on all servers

EWS is giving HTTP Status 500’s for specific users

Scenario:  You have a user complaining that they cannot access mail through Outlook 2011. When you search the Exchange servers IIS logs, you see a bunch of HTTP 500 responses provided by the Exchange server only for that user.  You also found out that this user is on travel.

Resolution:  Instead of changing the timezone to reflect the area the user was in, the user adjusted the current time.  Changing the timezone to where they were at or adjusting the time back to the current time of the original time zone resolved this issue.

A mailbox receives “The recipient’s mailbox is full and can’t accept messages now” or “The message store has reached its maximum size.”

Scenario: Customer emails a recipient and receives this error message:
The recipient’s mailbox is full and can’t accept messages now. Please try resending this message later, or contact the recipient directly.#554-5.2.2 mailbox full 554 5.2.2 
STOREDRV.Deliver.Exception:QuotaExceededException.MapiExceptionShutoffQuotaExceeded; Failed to process message due to a permanent exception with message Move/Copy messages failed. 16.55847:4000000 

The sender may also receive the following error message in Outlook: 
The message store has reached its maximum size. To reduce the amount of data in this message store, select some items that you no longer need, permanently (Shift + Del) delete them. 

The sender may also receive the following error message in Outlook Web App: 
The action couldn’t be completed. An error occurred on the server.  

Cause: This occurs if the items in the Recoverable Items folder of the recipient have exceeded the default quota of 30 gigabytes (GB).  

Resolution: Administrator needs to increase recoverable items quota for the recipients by using this one liner: set-mailbox -recoverableitemsquota 50GB -UseDatabaseQuotaDefaults $false

Powershell Check to see if mailbox exists

Scenario:  You have a list of mailboxes that you do not know if they still exist or not.  Instead of checking one by one, you can script this.  

In my users.csv I have a header with Name that contains all of the aliases underneath.


$users = Import-csv C:users.csv
$users | ForEach { $exist = [bool](Get-mailbox $_.name -erroraction SilentlyContinue); Write-host “$Exist $_.Name”}

Rebuild the Content Index for an Exchange Database

Within Exchange Powershell, change the Directory to the scripts directory of your Exchange Install Location.  Run either of the following commands to rebuild the content index for a single database or all databases on a single server:

.resetsearchindex.ps1 -force <database>

or

.resetsearchindex.ps1 -force -all

Check the last transaction log file that was written into the Exchange database.

The Exchange store uses write-ahead transaction logs and checkpoint files to help prevent data loss. Transaction logs record all the changes that have been committed to the in-memory database, while checkpoint files record which logged transactions have been written to the on-disk database files.

To check the last log file that has been written to the on-disk database, you can run the following in Exchange PowerShell. It will  provide the Checkpoint file that was last committed.  Any log files after that checkpoint file have not been committed to the on-disk database yet, where any log files prior have already been written and can be safely removed if manual purge is required.

Powershell:  ESEUTIL /MK C:FilePathDatabaseLogsE00.chk

Results:
Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 14.03
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating FILE DUMP mode…
      Checkpoint file: E:DatabaselogsE00.chk

      LastFullBackupCheckpoint: (0x0,0,0)
      Checkpoint: (0x4E1617,80,0)      <– The log file may look like E00004E1617.log in the logs directory.
      FullBackup: (0x4D48C3,173,1E1)
      FullBackup time: 05/18/2014 06:01:36
      IncBackup: (0x4E0CB3,447,48)
      IncBackup time: 05/23/2014 05:04:41
      Signature: Create time:06/05/2012 15:17:03 Rand:89681821 Computer:
      Env (CircLog,Session,Opentbl,VerPage,Cursors,LogBufs,LogFile,Buffers)
          (    off,   2027, 101350,  16384, 101350,   2048,   2048,1804596)


Operation completed successfully in 0.32 seconds.


Reference

Transport service won’t start on exchange 2010 server.

Issue: Transport service won’t start on exchange 2010 server.
Event log details: Transport Mail Database: MSExchangeTransport has detected a critical storage error, updated the registry key (SOFTWAREMicrosoftExchangeServerv14TransportQueueDatabase) and as a result, will attempt self-healing after process restart. Event id: 7001/17106

Resolution: Stopped transport service, remove queue database, restart transport service

Giving Reviewer Rights to a calendar of a bunch of Exchange Mailboxes

To give calendar reviewer rights to a user called nosey1 to bunch of mailboxes, use this one liner below. you will need to add their email aliases
to a text file.

Get-content C:scriptsCalperm.txt | ForEach-Object {Add-MailboxFolderPermission $_”:Calendar” -User nosey1 -AccessRights Reviewer}