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

New CMDlet: Clean-MailboxDatabase in Exchange 2013
Command is Update-StoreMailboxState

Examples:
This updates the mailbox state for a mailbox located on the mailbox database DB01
Update-StoreMailboxState -Database DB01 -Identity GUIDof DB

 
This updates the mailbox state for a mailbox located on the mailbox database DB01 with a GUID of 4a830e3f-fd07-4629-baa1-8bce16b85d44.
Update-StoreMailboxState -Database MDB01 -Identity 4a830e3f-fd07-4629-baa1-8bce16b85d44
 
This updates the mailbox state for all disconnected mailboxes on the mailbox database DB01.
Get-MailboxStatistics -Database DB01 | Where { $_.DisconnectReason -ne $null } | ForEach { Update-StoreMailboxState -Database
$_.Database -Identity $_.MailboxGuid -Confirm:$false }

Get-ADGroupMember : The size limit for this request was exceeded

Scenario:  You are using PowerShell for Active Directory to export a list of members in a group, but you receive this error:

Get-ADGroupMember : The size limit for this request was exceeded

Work Around:  Run this following command:

$grp = get-adgroup groupname -properties members 
$grp.members | get-aduser | Select Name | Export-csv C:\temp\exportsgroupmembers.csv

Cancel a Remote Wipe Request from a Mobile Device via Powershell

Scenario:  A user has found a missing mobile device. While the device was missing, the user has initiated a remote wipe on it.  We want to prevent the remote wipe from occurring when the phone is powered back on.

Solution: Run this via Exchange Management Shell:

clear-activesyncdevice <identity> -cancel:$true

Note: I tried running the -cancel $true as stated in the article, but I received this error:
A positional parameter cannot be found that accepts argument ‘True’.  I replaced it with -cancel:$true

Microsoft Article Reference

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

PublicFolders health set is “Unhealthy” after you install Exchange Server 2013 Cumulative Update 3

Issue: PublicFolders health set is “Unhealthy” after you install Exchange Server 2013 Cumulative Update 3
Scenario: Installed cu3 for exchange 2013, no public folder mailboxes on exchange 2013, get-healthreport gives unhealthy status for public folders
Resolution: Create an override for all servers using version bound override
Add-GlobalMonitoringOverride -Identity “PublicfoldersPublicFolderLocalEWSLogonEscalate” -ItemType “Responder”-PropertyName Enabled -PropertyValue 0 -ApplyVersion “15.0.775.38”
Add-GlobalMonitoringOverride -Identity “PublicfoldersPublicFolderLocalEWSLogonMonitor” -ItemType “Monitor” -PropertyName Enabled -PropertyValue 0 -ApplyVersion “15.0.775.38”

Add-GlobalMonitoringOverride -Identity “PublicfoldersPublicFolderLocalEWSLogonProbe” -ItemType “Probe” -PropertyName Enabled -PropertyValue 0 -ApplyVersion “15.0.775.38”

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}

Add a Calendar Meeting in Outlook through Powershell

The link at the bottom of this blog contains a good script that will allow you to create calendar meetings in Outlook through PowerShell.  This was helpful when I had to buildup a calendar in size to simulate another users exchange calendar for testing.    Below are the changes I made to the script so I could add attachments into newly created calendar appointments.  I know-I know, we shouldn’t be adding attachments into the appointment directly, hence the reason for the simulation of the problems the user is experiencing that needs to be proven.

I added this parameter/variable in the list of parameters:
    # Attachment Location, to hold value similart to: C:folderattachment.jpg
    [string] $file

I added this scriptlet to the Process:     
         $attachment = new-object System.Net.Mail.Attachment $file
         $newCalenderItem.Attachments.Add($file)

Boom. Now I can run the following command to create an appointment and add an attachment to build up the size of the calendar:

Add-CalendarMeeting -Subject “test recurring219” -Location “Steves Cube” -Body “Test” -MeetingStart “5/14/2014 18:00” -MeetingDuration 30  -file “C:UsersusernameDesktopfileabstract.jpg”

Link to the Original Script for download.

Removing Duplicate Contact Items in a Exchange Mailbox

Scenario:  You have a mailbox that has hundreds of copies of their contacts in their mailbox.  For example, a user originally had 2500 contacts and now has 800,000 contacts because of the multiple copies.   Here are the steps I followed to resolve this issue.

1. Export their contacts in the users Outlook to a CSV.   In my scenario, the outlook session was locking up so I exported the PST out via Exchange Shell and then re-exported to a CSV out of Outlook. (New-MailboxExportRequest mailbox -IncludeFolders “#Contacts#” -ExcludeDumpster -FilePath servershare$contacts.pst -name mailbox  -acceptlargedataloss -baditemlimit 999)

Outlook 2013:  File–>Open&Export–>Import/Export–>Export to a File–>Comma Separated Values–>Select Contacts Folder–>Save Exported File to location –> Click Finish.

2. Open Powershell, and Import the CSV created in step 1 into a Variable.
$File = Import-CSV “C:usersusernamedesktopuserscontacts.csv”

3. Select the unique values for the $File, compares all columns.
$uniq = $File | Select * -unique

4. Export the unique values to a .csv file
$uniq | Export-csv “C:usersusernamedesktopuserscontacts_unique.csv”

5. Delete the existing contacts in the users mailbox via Exchange Shell.  The Search-Mailbox has a 10,000 item limit. I put the command in a loop so it continues to remove all contacts at 10,000 per loop cycle.

do {
Write-Host $i
Search-Mailbox mailbox -SearchQuery kind:contacts -DeleteContent -Force
$i++
}
while ($i -le 81)

6. Opened Outlook 2013 and followed similar steps as step 1, except I performed the import on the unique CSV.  Note, I did have to clean up the CSV by removing the very first line as the very first line was not the column names.  In order for the CSV import to work, the first line needs to be the column names and NOT the other junk that export may have carried over.

Now the unique contacts are restored.