Exchange Stopped Working?

KB ID 0001749

Problem

I see various posts in online forums, and the process is held up because a lot of techs can’t do basic troubleshooting on their Exchange deployments. So I thought I’d put together some basic ‘first steps’ for you to do when your  ‘Exchange Stopped Working

This way you can at least get an error code to search for or a better idea of what’s going on.

Exchange Stopped Working – First Steps

Well it is Microsoft, reboot it, (yes turn it off and turn it on again.) I myself have lost time troubleshooting a problem that would have been cured with a simple reboot!

Disk Space: Look at you drives, if you are low on space, databases will fail to mount and bad things will happen, If you’re not backing up and logs are not getting flushed, then drives will fill up. It takes two seconds to check.

Services:  Next culprit, look for all the Exchange services that are set to ‘Automatic‘ and manually start them (some may start and stop and that’s OK), but if you get an error, then screenshot that error, look in event viewer and get a copy of the error/warning then you are armed with good internet searching ammunition!

Use The Tool

For a long time, Microsoft have supplied a Remote Connectivity Analyzer. Run though the tests on here.

Exchange Stopped Working – Are you Accepting SMTP?

The simplest test is to see if Exchange is actually providing main services (on TCP Port 25 (SMTP)). You can do this by (on the Exchange server).

[box]

telnet localhost 25

[/box]

And you should get a response (see below). If that fails, then the usual culprit, (if all the services are running), is AV software blocking port 25.

Exchange Stopped Working  – Test Email from CLI (Telnet)

I consider this a basic Exchange Skill, (the ability to send an email from command line). You first need to Telnet to the server (as above) you can then send an email. WARNING if you make a mistake, or have a typo (even if you correct that typo, before hitting enter) it will error! If in doubt write all your commands in notepad and paste them in!

Commands to use;

ehlo {Enter}

This is an ‘Extended’ helo (yes that’s spelled correctly) it opens communications and the server should respond with a list of the services it offers.

Tech Note: Also a good way to see if TLS is supported (it should respond with 250-STARTTLS)

mail from: {email-address} {Enter}

This can be ‘any’ source email address, even one that does not exist.

rcpt to:{email-address} {Enter}

Needs to be an email address that this Exchange has a mailbox for (on a domain that it’s authoritative for).

data {Enter}

Then type some text, you can continue typing as much text as you like.

.{Enter}

That’s a full stop, (period for the US), followed by Enter.

Then, (assuming it was successful and said 250 2.6.0 mail queued for delivery). If not you have an error code to Google. Check the mail was received.

Exchange Stopped Working – Test ‘Inbound’ Mail flow.

If you got this far then internally things are looking healthy, you need to see if you can accept mail from ‘Outside’. Repeat the test you carried out above but for a machine on the public internet, telnet in to the public DNS name of your Exchange and send an email via command line.

This proves your DNS is correct*, your firewall is setup correctly, and your Exchange is receiving mail. 

*Note: Assuming you connected to the DNS name, (if you connected to the public IP then your problem may be DNS!)

Exchange Stopped Working – Test ‘Outbound’ Mail flow.

This one is easy to troubleshoot, send an outbound mail.

Locate the Exchange Toolbox > Queue Viewer.

Look for mail ‘stuck‘ on the outbound queue, in production there will probably be hundreds of them, but what you are looking for is an error message. In the example below that’s 451 4.4.397 (Which I forced to happen by blocking outbound traffic from the Exchange server on the firewall). If you see this make sure the Exchange has TCP port 25 open outbound. 

Now you have enough information to either get on the forums and search, or open a new question if your stuck (AND TRY SEARCHING THIS WEBSITE FOR THE ERROR (TOP RIGHT)). I’ve fixed a few!

Related Articles, References, Credits, or External Links

NA

Exchange – Move ‘ALL’ Mailboxes From One Database to Another

KB ID 0000864 

Problem

While replacing an Exchange Server on my test network last week, I needed to get all the mailboxes moved across to the new one. Exchange gets upset if you try and delete a mailbox database that has data in it.

Solution

1. Launch the Exchange Management Shell > Firstly lets get the names of my Databases, then I can simply copy and paste them into the move mailbox command.

[box]

Get-MailboxDatabase

Get-Mailbox -Database Source Database Name -ResultSize Unlimited | New-MoveRequest -TargetDatabase Target Database Name

[/box]

2. The Mailbox moves should then be queued, depending on how many there are, this can take some time to complete.

3. To check on progress issue the following command;

[box]

Get-MoveRequestStatistics -MoveRequestQueue Target Database Name

[/box]

 

4. When complete you should remove the movement requests like so;

[box]

Get-MoveRequest | where {$_.status -eq “Completed”} | Remove-MoveRequest

[/box]

5. That’s all the ‘user’ mailboxes, but your source database server may have system mailboxes in it. These will be either Arbitration mailboxes, or Archive Mailboxes (or both). I don’t have any archive mailboxes, but I do have Arbitration mailboxes. To find out for your databases, use the following commands;

[box]

Get-Mailbox -Database Source Database Name -Arbitration

[/box]

6. To move Arbitration and Archive mailboxes, use the following commands;

[box]

Get-Mailbox -Database Source Database Name -Arbitration | New-MoveRequest -TargetDatabase Target Database Name

Get-Mailbox -Database Source Database Name -Archive | New-MoveRequest -TargetDatabase Target Database Name

[/box]

7. You can monitor progress with the same command you used in step 3, and remove the move requests with the same command you used in step 4.

8. In addition you may also have some Auditlog mailboxes like so;

[box]

Get-Mailbox -Database Source Database Name -Auditlog | New-MoveRequest -TargetDatabase Target Database Name

[/box]

9. Also you may have Monitoring Mailboxes, (In the screenshot below you can see I don’t have any archive mailboxes, as the command returns no results)

[box]

Get-Mailbox -Database Source Database Name -Monitoring | New-MoveRequest -TargetDatabase Target Database Name

[/box]

10. When complete remove the move requests;

[box]

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

[/box]

11. Finally on Exchange 2013 (and newer) you may also have Public Folder Mailbox(s).

[box]

Get-Mailbox -Database Source Database Name -PublicFolder | New-MoveRequest -TargetDatabase Target Database Name

[/box]

Don’t forget to remove any outstanding move requests.

Related Articles, References, Credits, or External Links

NA

Exchange – Display Mailbox’s by size

KB ID 0000469

Problem

Yesterday a client asked me how he could find out, which of his users were the “worst offenders” for mailbox size. Normally a simple Get-MailboxStatistics command would be fine, and we would sort the results in descending order.

Solution

On one of the Exchange servers, launch the Exchange Management Shell.

Issue the following command:

Note: That’s all one command, replace the name PNL-MAIL-2019 with your Exchange server name.

[box]

Get-MailboxStatistics -Server PNL-MAIL-2019  | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending

[/box]

And here’s your nicely formatted list (Note: this is my test environment so there’s not much mail in it).

Fo Exchange 2010 use the following syntax;

[box]

Get-MailboxStatistics -Server DC2A | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

[/box]

Note: To see the sizes of the individual Folders in users mailboxes see the following article;

Exchange – Display/Export Users Mailbox Folder Sizes

Related Articles, References, Credits, or External Links

NA

Outlook: ‘Exchange Administrator has Made a Change That Requires You Quit’

KB ID 0001372

Problem

Last week I had a client report that ‘some’ of his users were getting this popup repeatedly, every time they launched Outlook.

The Microsoft Exchange administrator has made a change that requires you quit and restart Outlook

 

This popup is usually seen during migrations, when mailboxes are being migrated, (or have just been migrated.) But you should only ever see it once.

Solution

I had recently retired the client’s old Exchange Server (Exchange 2007)  So I assumed something must have been pointed at the old server,  the client also reported that Recreating the Outlook profile also cured the problem. Which added weight to my theory.

I guessed (correctly as it happens) that the problem was the Public Folders on the old server. The client wasn’t using them, but I thought, the migrated users might still be trying to connect to them, I tried to cure the problem by forcing the clients NOT to look for Public Folders with the following registry key;

[box]HKEY_CURRENT_USER > Software > Microsoft > Exchange > Setup[/box]

Create 32 Bit DWORD: HasPublicFolders

Value: 0 (Zero)

Unfortunately that didn’t fix the problem, (in my case, however, some people reported it did solve theirs). I know from experience that public folders settings used to be defined, on the mailbox database, so I checked all the mailbox database attributes, and found the problem.

To view your Mailbox Database Attributes you need to look pretty deep into Active Directory, which means using ADSIEdit. When launched, connect to the ‘Configuration’ context.

Configuration > CN=Services > CN=Microsoft Exchange > CN=your organisation name > CN=Administrative Groups > CN=Exchange Administrative Group > CN=Databases > CN=your database name > Properties > Locate MSEXCHHomePublicMDB, and remove any value set.

At this point I rebooted the Exchange Server, and the affected clients, and the problem was resolved.

Related Articles, References, Credits, or External Links

NA

Event ID 9877

KB ID 0000468 

Problem

Content Indexing function ‘CISearch::EcGetRowsetAndAccessor’ received an unusual and unexpected error code from MSSearch.
Mailbox Database: {Database Name}
Error Code: 0x80041606

Solution

Basically there’s a problem with the catalog data for the database, we need to recreate it. WARNING this can use a fair bit of CPU power to recreate, so you might want to do it at the end of the day.

1. On the Exchange server that’s hosting the database that’s giving you the error. Start > In the search/run box type services.msc {enter} > Locate the Microsoft Exchange Search Indexer Service and stop it.

2. Navigate to the folder that holds the problem Database (Look In Exchange System Manager > Organizational Configuration > Mailbox > Database Management > Right click the problem Database > Properties). Within the folder you will find another folder called CatalogData-xxxxxxxxxxxxxxxxxx > Delete this folder.

3. Then restart the Microsoft Exchange Search Indexer Service.

4. The catalog will now rebuild.

 

Related Articles, References, Credits, or External Links

NA

Microsoft Exchange RPC Client Access Service Does Not Start

KB ID 0000802 

Problem

I build a new SBS 2011 environment last week, and I had just put on the new digital certificate, and as no one was using it, I simply rebooted the SBS Server and went for a coffee. From that point forward all the new Outlook 2013 clients give me this error,

Cannot start Microsoft Outlook. Cannot open the Outlook window. The set of folders cannot be opened. You must connect to Microsoft Exchange with the current profile before you can synchronize your folders with your Outlook data file (.ost).

Solution

1. At first I thought this was a user profile problem, so i logged on as another user (no difference). So I thought it was a problem with Outlook/Office on that PC. Until I built another one and it did the same. If you are seeing this error I suggest you remove the Outlook profile on the affected machine first.

2. Some Google searching told me this can happen if certain services have not started, as I had this problem on the same server, I checked the services and sure enough the Microsoft Exchange RPC Client Access’ service was not running. I could manually start it, and the error ceased. That’s great but I needed to deliver the server to a client and I wouldn’t be about to manually start services every time they rebooted it!

3. It turns out that this is a known problem if Exchange is installed on a Global Catalog server (being an SBS Server I don’t have much choice). it is supposed to be addressed by Microsoft KB940845, I say ‘supposed to‘ because this did not work.

4. Despite my best efforts, this service refused to start with the server, so I clipped on my spurs and wrote a startup script that waits three minutes after the server starts then it manually starts the service for me. You can put it in the servers Startup folder, or (as I did) assign the startup script via group policy.

Note: This script waits 180 seconds, you can change the interval if you wish.

Related Articles, References, Credits, or External Links

NA

SBS – No Incoming Mail ‘421 4.3.2 Service not available’

KB ID 0000803

Problem

While testing mail flow on a new SBS 2011 Server, outbound mail worked fine, but no mail would flow in. When I attempted to Telnet in from a remote host this was what I saw;

421 4.3.2 Service not available
Connection to host lost.

Solution

Normally I’d expect to see an error like this if the Exchange ‘Receive Connector’ was misconfigured, (if you’re not using SBS 2011 create a new default receive connector and make sure there are no firewalls in the way).

If you are using SBS 2011 you need to run the ‘Connect to the Internet’ Wizard (seriously!)

After this check inbound mail flow again.

Related Articles, References, Credits, or External Links

NA

Allow a Server to “Relay” Through Microsoft Exchange

KB ID 0000542

Problem

Back in the early days of email, just about all mail servers let you relay mail though them. That was fine until someone worked out you could then get someone else to send out your “spam”, and they would look like the guilty party. Even today people misconfigure their Exchange servers and make them an open relay.

But what happens if you have a particular server or machine that you want to let use your Exchange server as a relay? e.g. a Linux server that sends mail, or a SQL server running SQLMail? Then you need to allow relaying from either that IP address, or the network it’s on.

Allow Relay from an IP with Office 365 (Exchange Online)

Allow Relay from an IP with Exchange 2016 & 2013

Allow Relay from an IP with Exchange 2010

Allow Relay from an IP with Exchange 2007

Allow Relay from an IP with Exchange 2003

Allow Relay from an IP with Exchange 2000

Solution

Allow Relay from an IP with Exchange 2010 and 2007

1.From the Exchange Management Console > Server Configuration > Hub Transport > New Receive Connector.

2. Give the connector a name and select Custom > Next.

3. Next.

4. Add > Add in the IP address(s) or network you want to allow relay from > OK.

5. Select the 0.0.0.0 255.255.255.255 entry and click DELETE.

Warning: Leaving this entry in will make your Exchange Server an Open Relay. (Note: This does NOT mean that your default connector is an “Open Relay” as this uses “authentication”

6. Next.

7. New.

8. Finish.

9. Select your new connector then right click > Properties.

10. On the Permission Groups tab ensure “Exchange Servers” is selected.

11. On the Authentication Tab > Tick “Externally Secured (for example with IPSEC).” > Apply > OK.

Allow Relay from an IP with Powershell

The following Powershell does the same as above;

[box]New-ReceiveConnector -Name “Server2 Allow Relay” -usage Custom -Bindings ’0.0.0.0:25′ -RemoteIPRanges 172.16.254.207 -server DC2A – -permissiongroups ExchangeServers -AuthMechanism ‘TLS, ExternalAuthoritative’[/box]

Allow Relay from an IP with Exchange 2003 and 2000

1. Launch Exchange System Manager > Administrative Groups > Administrative group Name > Servers > Servername > SMTP > Right click Default SMTP Virtual Server > Properties.

Note: If you can’t see administrative groups right click the top level (in this case “First Organization (Exchange)) and tick the box to show administrative groups.

2. Access Tab > Authentication > Ensure “Anonymous Access” is enabled.

3. Click Relay > Ensure the default of “Only the list below” is selected > Add.

4. Add in the IP addresses(s) networks or domains you want to allow ‘relaying’ from > OK.

5. OK > Apply > OK.

 

Related Articles, References, Credits, or External Links

Exchange – Are you an Open Relay?

Exchange PST Import Error – ‘Couldn’t connect to the target mailbox’

KB ID 0000801

Problem

I was trying to import some PST files into SBS 2011, and got the following error;

Couldn’t connect to the target mailbox

Solution

Before you proceed, make sure the user you are logged in as, and are attempting to perform the New-MainboxImportRequest command has been granted the rights to carry out mailbox imports, read the following article;

Exchange 2010 (Post SP1) Bulk Importing Mail From pst Files

Note: If the machine you are importing into is part of a CAS array you may also see this error, to fix that problem you need to create a temporary mail database and move the target mailbox into it, then change the RpcCLientAccessServer property for that database, like so;

[box] set-MailboxDatabase TEMPDB -RpcClientAccessServer Exchange01.petenetlive.com[/box]

1. Make sure the folder you are importing from (this has to be a UNC path NOT a path to local folder!) has permissions granted to it for the Trusted Exchange Subsystem group.

2. If your machine is also a global catalog server, (Note: As mine is an SBS server, and the only DC I don’t really have a choice.) You may find that the ‘Microsoft Exchange RPC Client Access’ service is not running, start it manually then attempt the import again.

 

Related Articles, References, Credits, or External Links

NA

 

Exchange 2013 – ‘The WinRM Shell client cannot process the request’

KB ID 0000855

Problem

After building a new Exchange 2013 Server on my test network and changing the Certificate over, I ran a few updates and rebooted. Post reboot I was greeted with this,

VERBOSE: Connecting to PNL-EX2013.petenetlive.net.
New-PSSession : [pnl-ex2013.petenetlive.net] Processing data from remote server pnl-ex2013.petenetlive.net failed with the following error message: The WinRM Shell client cannot process the request. The shell handle passed to the WSMan Shell function is not valid. The shell handle is valid only when WSManCreateShell function completes successfully.
Change the request including a valid shell handle and try again. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : -2144108212,PSSessionOpenFailed
Failed to connect to an Exchange server in the current site.
Enter the server FQDN where you want to connect.:

Solution

Everything was working fine before I changed the certificates, and all the management runs out of IIS so I headed there first. I found when I checked the ‘bindings’ for the ‘Exchange Back End’ site that HTTPS did not have a certificate selected.

After I selected the correct certificate, the Command Shell opened fine.

Related Articles, References, Credits, or External Links

NA