Exchange Management Shell
-
Removing mail with the same subject from the Exchange Queues
Sometimes you need to remove thousands of e-mails in your Hub Transport server queues. We see this every now and then with mail storms from an application that went off the rails or maybe with 2 mailboxes sending each other auto replies causing a mail loop. There’s a few ways to stop the mail storm before removing the mail items in your Exchange queues but that is not the scope for this article. If you are ever in the situation of thousands of mails queued on all your Hub Transport servers then the below cmdlet should help you to quickly remove those mails from the queue. (Obviously do this with…
-
Unable to access or move a mailbox receiving error the mailbox is disabled when it’s not
If you ever try to move a mailbox and you receive an error that the mailbox is disabled but you have checked and the mailbox is not disabled then try the following: (other errors we received was trying to access the mailbox using Outlook Web App and stating it’s disabled or from Outlook stating you need to connect to Exchange) Verify that the mailbox is indeed not disabled. If not proceed to the next steps Open Exchange Management Shell and run: Set-CASMailbox -Identity mailboxSMTPAddress@domain.com -MAPIEnabled $False Wait for replication Run: Get-CASMailbox mailboxSMTPAddress@domain.com (check that it shows MAPI Enabled is false) If MAPI Enabled is false run: Set-CASMailbox -Identity mailboxSMTPAddress@domain.com -MAPIEnabled $True Wait for…
-
VB.Net application unable to connect to some Exchange 2010 mailboxes
We had an interesting issue last week where a Visual Basic .Net application could connect to some mailboxes but could not connect to other mailboxes on Exchange 2010. The application uses MAPI to connect to the mailboxes. We were however able to access the affected mailboxes using Outlook and with the MFCMAPI tool from the application server. We moved the affected mailboxes to other servers and databases but the application could still not connect to the affected mailboxes. We then added our CAS Array name and IP in the application server’s host file and checked the Exchange RCA logs. We could not see any connections from the application server to…
- Active Directory, Exchange 2007, Exchange 2010, Exchange Management Shell, Exchange Online, Exchange Tools, Microsoft Exchange, Office 365
Error due to mismatch of GUID: Recipient “NameOfRecipient” has mismatched Archive GUID
You receive the error “Recipient “NameOfRecipient” has mismatched Archive GUID” when you try and off board a mailbox from Exchange Online to on premises Exchange. Follow the below steps o resolve the issue and migrate the mailbox back to the on premises Exchange environment: Logon to Exchange Online using Powershell. Run: get-mailbox user | fl *archiveguid* Make a note of the GUID Open Exchange Management Shell on premises Run: Get-RemoteMailbox User | fl *archiveguid* You should see that the GUID on prem is different to the GUID from Exchange Online To resolve, in Exchange Management Shell on prem run: Set-RemoteMailbox User -ArchiveGuid “GUID you got from Exchange Online” The above should work without…
-
Unable to connect a disconnected mailbox – User not found error when trying to connect a mailbox to a user in Exchange
We’ve had a few instances where we need to disconnect a mailbox and reconnect it to a new user account for a user. This should be easy right? Well not always. It’s happened more than once where we try to use the Exchange Management Console to connect the mailbox to the user account but Exchange can’t find the user account. Have a look in Active Directory and the account shows up. You then try to connect the mailbox to the user account using the Exchange Management Shell with the same results. user not found. See below on how to get this issue resolved: 1. Open adsiedit.msc (start, run and type…
-
Deleting disconnected Mailboxes in Exchange 2007
Purging disconnected mailboxes in Exchange 2003 was quick and easy. With Exchange 2007 you need to use the Exchange Management Shell to purge/delete the disconnected mailboxes. Below are some examples on how to delete disconnected mailboxes in Exchange 2007. Make sure that you need to delete the disconnected mailboxes as it’s easier to reconnect a disconnected mailbox if a user account and mailbox got deleted by accident. Delete a specific disconnected mailbox: 1. Get-MailboxDatabase (this will show you the database names) 2. Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid (view the user’s GUID here) 3. Remove-Mailbox -Database “Type Your Database Name Here“ -StoreMailboxIdentity Type the Users Mailbox GUID Here -confirm:$false…
-
Export mailbox sizes in Exchange 2010 using Exchange Management Shell
Thought I’d share two scripts today. I use both daily to export mailbox sizes to a csv file for reporting purposes. These scripts will export the following: User Display Name, Database where the mailbox is homed ,the mailbox’s Total Item Size, Item Count in the mailbox and the Storage Limit Status Export a report on mailbox sizes on a specific server: Get-Mailbox –Server the server name –ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize, -Ascending | Export-CSV driveletter:\foldername\reportname.csv Export a report for mailboxes homed on all your mailbox servers: Get-ExchangeServer -Domain your domain name | Get-MailboxStatistics | sort TotalItemSize -Descending | select DisplayName, Database, StorageLimitStatus,…