Recently I ran into an issue with a Lync environment (2010) where Lync conversations were not being saved to the “Conversation History” folder in Outlook (2010). Luckily there is a quick way to fix this issue, through Exchange. From the reading that I have done it seems like the most common reason this occurs is when a user in your Exchange environment reaches or surpasses 1,000 combined folders and sub folders in their mailbox. The easiest way to check if a user has reached this threshold is to use the Exchange Management Shell to quickly take a look at their total combined mailbox folders using the following command.
(Get-MailboxFolderStatistics “user”).Count
Easy enough, often times this is enough to determine the cause. But I have taken this command one step further and wrapped it into a little script that will go through your Exchange environment and record all users that have reached this threshold and place their display name as well as the number of folders/subfolders into a csv file for an easier to reference. Here is the logic of the script.
$mailboxes = Get-Mailbox $overlimit = @() ForEach ($mailbox in $mailboxes) { $mbxmember = New-Object PSObject $folders = (Get-MailboxFolderStatistics $mailbox).Count $mbxmember | Add-Member -MemberType NoteProperty -Name "Display Name" -Value $mailbox.DisplayName $mbxmember | Add-Member -MemberType NoteProperty –Name “Folder Count” –Value $folders If ($folders -gt 1000) { $overlimit += $mbxmember } } $overlimit
That logic right there is very basic but will iterate over all mailboxes in the Exchange environment, grab those with over 1,000 folders/sub folders, place them into an array and output the array. This will take a while depending on the size of your environment, so feel free to let it run in the background. It is not a super intensive process, it just takes forever. To get this into a CSV file use the following Powershell command, I have this script name Get-Folders.ps1 in this example.
.\Get-Folders.ps1 | Export-CSV users.csv
That should be it. Not everybody will need this obviously but I found that it came in handy.