ExchangeNerd

Powered by Ed Buford and Coffee

Tag: Exchange

Clean that Database!

Clean Database command missing in Exchange 2013

Sometimes you need to disable a mailbox you need to be able to see it as a disconnected mailbox right away. In the Past you’ve been able to use the Clean-Mailboxdatabase command.  I would normally tend to run the clean command against all databases since the command doesn’t draw much in the way of resources. So for me the command would look like this:    Get-Mailboxdatabase | Clean-Mailboxdatabase

But as with everything the times are constantly changing and so are the commandlets that go with them. Which brings me to Exchange 2013 where the Clean-Mailboxdatabase command no longer works. Now the command is Update-StoreMailboxState and sadly it’s not a simple command to clean all the databases – in fact to run the command you need to know the database and mailbox GUID. Now this is going far… but I digress…

Anyway if you know the database you can attack it like this:

Get-MailboxStatistics –Database DB01 | ForEach { Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$false }

 

GetMailboxStatistics Database MDB02 |ForEach { UpdateStoreMailboxState Database $_.Database Identity $_.MailboxGuid Confirm:$false }

It’s Midnight, Do you know where your FSW is?

Your FSW is more important than you may think!

Over the past couple of weeks I’ve seen two Database Availability Groups that had their File Share Witness go missing on them. In both cases the server which housed the FSW were replaced and the FSW role was not recreated.

I’m guessing you’re asking yourself “how that can ever happened?” The truth is it’s a lot easier than you think. With a 2 node cluster and File Share Witness you only need 2 nodes up to have a Quorum. This means if both of your DAG servers are up good, or if one DAG server a and the FSW is up you’re still good. The problem is that a well configured Exchange server is kind of “Set it and Forget it” and losing a FSW can have no impact on you at all when the Servers are both up. However when one of your servers go offline for whatever reason, the remaining server relies on the FSW to hold a quorum. IF you don’t have enough nodes to maintain a Quorum then all your Database will DISMOUNT!

This action is by design, there is a crazy thing that could happen to you called Split Brain where you would write different data to your 2 copies of the database that leaving it out of sync. Since you don’t that to happen you need the  FSW.  The FSW is a great thing that should not be forgotten!

One way to tell if your FSW is online is to use the Fail Over Clusters powershell tools. You can do that from your Exchange Server. I always do it from the Standard PowerShell console (I don’t know why) but the module will load into your EMS as well.

Import-Module FailOverClusters

Get-ClusterResource

Depending on your status the output should look like one of these:

2015-06-01_16h03_33

Or you could create a task to in your event log to email you if this error shows up in your Event Logs

2015-06-01_15h54_17

Here’s a link on how to do that: https://technet.microsoft.com/en-us/library/cc732728.aspx

[Top]

SBS 2011 Exchange Hybrid with Office 365

SBS 2011 Exchange Hybrid – don’t bother

The short answer is you can’t do it.

Ok that might not be enough for you so let me give you a longer answer which I hope will satisfy you and if doesn’t then good luck and God Speed!

So here’s what you’re going to hear: SBS 2010 has Exchanger 2010 on it and all you have to do is make sure it’s on SP3 and you can run the Hybrid Configuration Wizard. While this is true enough you can run the HCW you can’t however connect your Exchange server to another forest which is essentially what you’re doing when you Add the Exchange Forest.

hybrid

When you go to add that Exchange Forest you’re going to start to run into issues even though you were able to run the HCW.

Notice from this next screenshot you’re getting an error message complaining about the WinRM client and all that jazz but also notice you can’t change the domain… no matter what you do here you can’t… Which means you can’t log into Office 365 which means this will not work.

Hybrid1

I worked with a great engineer from Microsoft and between the two of us we put in way more time than we should have on this issue simply because the documentation isn’t out there that says you CAN’T do it… well here it comes. Sadly it’s not a lot of documentation but if there was enough documentation on this I would not be writing this post…

So here is the story:

You can’t add the Exchange forest because SBS 2011 won’t allow an Inter-Forest Trust

Hybrid2

Here is a link to the document SBS 1011 FAQ the screenshot above is from Page 4.
I hope this saves you the hours of time it cost me.

[Top]

Recover Deleted Items from Exchange Dumpster

I was having a conversation at lunch with a friend who needed to recover some items for a user from the Exchange Dumpster. So I came up with a one-liner to help you do just that but BEFORE i can really give you the one-liner I need to give you some background.

First there is a Deleted Items folder in your Exchange Mailbox. When you delete an email it goes here first (for many people that is as far as it goes but that’s another blog post…).
A user can simply look here in the their deleted Items folder and find something they have deleted if that folder has not yet been emptied.

If the Deleted Items folder has been emptied it will remain in the Deletions folder (Dumpster) for the next 14 days by default. During this time the user can use Outlook and or OWA to Recover Items that are now in the Dumpster.  I love this feature but it’s not very much fun for the user if they have deleted a lot of items lately. 

So to make things a little easier on the user you can recover all the items in PowerShell and then export them so the user can sort them to their hearts content.  The tricky part here is that you can’t drop them directly back into the mailbox you’re searching.  You can use the DiscoverySearchMailbox but I keep an admin mailbox around that I use for just such occasions. I call this mailbox SearchAdmin and it will become the Target mailbox.

The PowerShell command looks like this:

Search-Mailbox -identity ebuford -SearchDumpsterOnly -TargetMailbox SearchAdmin –TargetFolder ebufordDumpster

Search-Mailbox -identity ebuford -SearchDumpsterOnly -TargetMailbox SearchAdmin –TargetFolder ebufordDumpster

The three items in red are user mailbox you’re searching (ebuford) the target mailbox your dropping the files in (SearchAdmin) and the name of the Folder you want to dump them in (ebufordDumpster).

Once you’ve got them in the new folder you can export to a PST and then Import them back into the users mailbox. Now this isn’t the most straightforward admin task you’re going to do, but if you really want to please a user (or maybe your boss) this will make you some brownie points!

[Top]