StalledDueToTarget_Processor ?

StalledDueToTarget_Processor KB ID 0001810

Problem

If you have a mailbox move that’s showing as StalledDueToTarget_Processor, that’s quite common (I see that a lot).

Solution: StalledDueToTarget_Processor

Firstly how long have you waited? I see this when I’m moving a LOT of mailboxes, and most of the time this problem resolves itself – if you are patient enough, (and your users will be unaffected while this is going on).

If you have waited and there’s still no movement, you can try the following, locate the MSExchangeMailboxReplicaiton.exe.config file (it will be in your exchange/bin folder).

Edit the file, locate ‘MaxMRSConnections’ value and change it to 20, then save the file.

Note: I change these values on the source and destination Exchange servers, But documentation says you only need to do it on the sourse server.

Then restart the Microsodt Exchange Replication service on BOTH Exchange servers

[box]

Get-Service -Computername OTHER-EXCHANGE-SERVER -Name MSExchangeRepl | Restart-Service
Restart-Service MSExchangeRepl

[/box]

Update Feb 2023: I was moving about 1000 mialboxes, and roughly a third were stuck in StalledDueToTarget_Processor. So ‘after working hours‘ I rebooted both Exchange servers, and the status changed to failed. I cancelled the move requests, and restarted the migration, this time thay all completed sucessfully.(PL)

Related Articles, References, Credits, or External Links

Mailbox Move ‘StalledDueToMailboxLock’

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

Cannot Open Exchange Management Shell

KB ID 0001707

Problem

When attempting to open the Exchange Management shell you see the following;

[box]

         Welcome to the Exchange Management Shell!

Full list of cmdlets: Get-Command
Only Exchange cmdlets: Get-ExCommand
Cmdlets that match a specific string: Help **
Get general help: Help
Get help for a cmdlet: Help  or  -?
Exchange team blog: Get-ExBlog
Show full output for a command:  | Format-List

Show quick reference guide: QuickRef
VERBOSE: Connecting to {mail server}
New-PSSession : [{mail server}] Processing data from remote server {mail server} failed with the
following error message: [ClientAccessServer={mail server}BackEndServer={mail server},RequestId=f092f550-6451-
4dea-820d-20322101874a,TimeStamp=08/10/2020 09:24:58]
[AuthZRequestId=eb185d5f-6a49-471f-9267-ad0ce9231d0f][FailureCategory=AuthZ-CmdletAccessDeniedException] The user
"DOMAIN/{User-Name}" isn't assigned to any management roles. For more information, see the
about_Remote_Troubleshooting Help topic.

[/box]

When this happens you may also see Event ID 258 get logged;

[box]

Log Name:      Application
Source:        MSExchange RBAC
Date:          {date} {time}
Event ID:      258
Task Category: RBAC
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      {Mail Server}
Description:
(Process 9680, PID w3wp.exe)"RemotePS Public API Func GetApplicationPrivateData throws Exception Microsoft.Exchange.Configuration.Authorization.CmdletAccessDeniedException: The user "{Domain/user-name}" isn't assigned to any management roles.

[/box]

Solution

I’ve highlighted the most pertinent text in the error messages (above), that being;

The user “{Domain/User-Name}” isn’t assigned to any management roles.

For once Microsoft error messages are actually quite descriptive and helpful! The user that you are attempting to open the Exchange Management Shell with does not have the Exchanger administrative rights to do so! Typically to manage Exchange you need to be a member of the ‘Organization Management’ group, (my Englishness OCD hates that spelling!) 

So, (obviously using your administrative account NOT you normal user account ;P ) Add yourself to that group.

Remember, granting rights via a ‘group‘ means you will have to log off, and then back on again, before you actually get those rights.

Related Articles, References, Credits, or External Links

NA

Can I ‘Shrink’ My Exchange Database?

KB ID 0001706

Problem

Saw this asked in a forum today, and my response was;

It never gets smaller, if you delete things out of it, it just creates more ‘whitespace’ within the database, unless you;

a) Take it offline, and defragment it using eseutil.
b) Move the mailboxes out of it, to another database and delete it.

Which is true, but even Microsoft say you should not need to defragment a database! Before you do anything make sure you have a good backup of Exchange and the mailbox databases!

Defragment an Exchange Database

Stop! Why are you doing this, if it’s because you are running out of room, then migrating mailboxes out of a database into another database, on another piece of storage with more room is what you should be doing, and does not involve long periods of downtime!

If you have just deleted hundreds of GB from a mailbox database, and you simply want to compress the DB, and you have a BIG window for downtime, (allow 1 hour for every 9GB of database size). Then you are in about the only use case scenario I can think of to want to do this!

Before You start: This process creates a temporary mailbox database, (you need to tell it where), if you are pressed for room, I suggest you add another volume/drive and put it there. (Though in my example I have room in the same folder). Allow for the entire database’s existing size plus ten percent to be on the safe side.

Let’s have a look, and see how  much room we might be able to reclaim (whitespace);

[box]

Get-MailboxDatabase -Status | Select Name, DatabaseSize, AvailableNewMailboxSpace

[/box]

The database has to be dismounted before you can run Eseutil on it (downtime starts here).

[box]

Dismount –Database Database Name

Eseutil /d C:\Folder\DatabaseName.edb> /t T:\Folder\TempDB.edb>"

[/box]

When complete, mount the datastore again, (downtime ends here).

[box]

Mount-Database Database Name

[/box]

Hopefully you should see the whitespace has decreased.

Don’t forget to set off a full backup of the store as soon at it’s back online.

Move Mailboxes To Another Exchange Database (To Reclaim Space)

This is the much more elegant solution, create a shiny new database move everything  from the old database into the new one, and delete the old database.

Will This Impact My Users? Any user using their mailbox while it is getting moved wont be affected, until the move is complete then they will see a popup that looks like;

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

Cool eh! So lets start by creating a New Mailbox Database.

[box]

New-MailboxDatabase -Name New Database Name -EdbFilePath C:\Folder\DB-Name.edb -LogFolderPath C:\Folder\Folder\

[/box]

Make sure you follow the advice and restart the information store, (yes you can mount the new DB and proceed, but Exchange does not allocate the resources correctly if you do this).

[box]

Restart-Service MSExchangeIS

[/box]

Let’s move our ‘Normal’ mailboxes to the new DB.

[box]

Get-Mailbox -Resultsize Unlimited | New-MoveRequest -TargetDatabase Target Database Name

[/box]

Depending on how many (and how large) mailboxes there are this can take a while, (days for large databases!) When they’ve all completed you need to remove the  move requests, (if you have any failures, or speed issues use the search box above, I’ve had to cope with thousands of these things not working correctly in my time!)

Let’s assume we are all moved, so we want to remove the move requests.

[box]

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

[/box]

Now let’s see if we have any Arbitration Mailboxes, we do so let’s shift them;

[box]

Get-Mailbox -Database Source Database Name -Arbitration

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

[/box]

Again, when complete, remove the move requests.

[box]

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

[/box]

Now let’s see if we have any Auditlog Mailboxes, we do so let’s shift them;

[box]

Get-Mailbox -Database Source Database Name -Auditlog

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

Get-MoveRequest | Get-MoveRequestStatistics

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

[/box]

Now let’s see if we have any Archive Mailboxes, we do NOT so I will skip them, let’s check for Monitoring Mailboxes, we have those so let’s move them;

[box]

Get-Mailbox -Database Source Database Name -Archive

Get-Mailbox -Database Source Database Name -Monitoring

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

[/box]

And clean those up as before.

[box]

Get-MoveRequest | Get-MoveRequestStatistics

Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

[/box]

Finally let’s see if we have any Public Folder Mailboxes, we have one of those so let’s move that;

[box]

Get-Mailbox -Database Source Database Name -PublicFolder

Get-Mailbox -Database Source Database Name -PublicFolder | New-MoveRequest -TargetDatabase Target Database Name
[/box]

We now need to remove the ‘Source‘ Database but first we need to dismount it.

[box]

Dismount-Database OLD Database Name

Remove-MailboxDatabase -Identity OLD Database Name

[/box]

I get an error message saying I cant delete the database.

 

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

Setup Cant Continue PowerShell Has Open Files

KB ID 0001633

Problem

While attempting to uninstall Microsoft Exchange server;

Setup can’t continue with the uninstall because the powershell (PID) has open files. Close the process, and then restart setup.

Solution

Seems to be a common error, and is usually caused because someone has the Exchange Web Management page open, (probably in another user session);

In some cases you may need to reboot, but in my case I was simply being a doofus, look at the window I’m running the command from! Open an administrative command window and try again 😉

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

Exchange Cant Mount Database ‘0x80004005’

KB ID 0001632

Problem

When attempting to mount an Exchange Database I got this error;

Failed to mount database “{Database-Name}”. Error: An Active Manager operation failed. Error: The database action failed. Error: Operation failed with message: MapiExceptionDatabaseError: Unable to mount database. (hr=0x80004005, ec=1108) Diagnostic context: Lid: 65256 Lid: 10722 StoreEc: 0x454 Lid: 1494 —- Remote Context Beg —- Lid: 1238 Remote Context Overflow Lid: 34760 StoreEc: 0xFFFFFDEF Lid: 41344 Guid: 6967a2e8-2e07-4c6f-a7ff-cb5f3414bad5 Lid: 35200 dwParam: 0x3F28 Lid: 59596 dwParam: 0x231090 Msg: JI20 Lid: 43212 dwParam: 0x231090 Msg: JT05 Lid: 43212 dwParam: 0x231090 Msg: JT08 Lid: 59596 dwParam: 0x231090 Msg: WM19 Lid: 59596 dwParam: 0x231090 Msg: WM20 Lid: 59596 dwParam: 0x231090 Msg: WM21 Lid: 54472 StoreEc: 0x980 Lid: 42184 StoreEc: 0x454 Lid: 10786 dwParam: 0x0 Msg: 15.01.1847.005:PNL-Mail:6967a2e8-2e07-4c6f-a7ff-cb5f3414bad5 Lid: 51578 Guid: 6967a2e8-2e07-4c6f-a7ff-cb5f3414bad5 Lid: 1750 —- Remote Context End —- Lid: 1047 StoreEc: 0x454 [Database: Database-Name, Server: Server-Name]

Solution

It’s been a while since I last saw an 0x80004005 error, last time it was because the AV software on the Exchange server had quarantined a log file, but this server was not running any third party AV. On closer inspection the problem was pretty obvious;

My ‘log-file’ partition was full, (I had something else doing diagnostic logging), once I tidied up the partition and freed up some space the database mounted without complaining.

Related Articles, References, Credits, or External Links

Exchange – Failed to mount database(hr=0x80040115, ec=-2147221227)

Event ID 3154 ‘Active Manager Failed To Mount Database’

Exchange Exporting Mailboxes to PST Files

KB ID 0001360

Problem

Applicable To: This procedure works on all versions of Exchange Newer than Exchange 2010 SP1 (update rollup 8). If your Exchange server is OLDER than that you will need to use the following link;

Exchange 2007 / 2010 (Pre SP1)- Export Mailbox’s to PST files

The following procedure exports a user mailbox to a PST file on a network share.

Solution

Note: Not Even ‘Exchange Organisation Administrators” have the right to import / export mailboxes, you need to grant those rights to your user object, (or a better approach would be to create an admin account just for this purpose, then delete it when you are finished).

[box]

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User {username}

[/box]

Note: This grants import, and export rights.

Create a file share on a drive with plenty of space, ensure the Exchange Trusted Subsystem has read / write access. And ensure the SYSTEM account has full control.

To create the ‘Export Request’

[box]

New-MailboxExportRequest -Mailbox “mailbox-alias” -FilePath \\server-name\share\file-name.pst

[/box]

Note: Add “-IsArchive” to the end of the command for Archive Mailboxes.
Note2: If the export repeatedly fails, add -BadItemLimit 200 to the end and try again, you can also use the -AcceptLargeDataLoss in exceptional circumstances

To view progress;

[box]

Get-MailboxExportRequest
OR
Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

 

[/box]

When complete, you need to remove the move request(s);

[box]Get-MailboxExportRequest | Remove-MailboxExportRequest
OR (If you still have movement requests running)
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest[/box]

Using Content Filters

You can specify a content filter to only export emails after a certain date all mail received after 01/01/17 e.g.

[box]New-MailboxExportRequest -Mailbox {mailbox-alias} -ContentFilter {(Received -lt ’01/01/2017’)} -FilePath \\{server-name}\{folder}\{file-name}.pst[/box]

Or to export emails between two dates;[box]New-MailboxExportRequest -ContentFilter {(Received -lt ’31/12/2018‘) -and (Received -gt ’31/12/2017′)} -Mailbox {mailbox-alias} -FilePath {server-name}\{folder}\{file-name}.pst[/box]

Using IncludeFolders (and Exclude Folders)

You can specify IncludeFolders (or ExcludeFolders) to only export emails from certain folders, e.g.

Only export Inbox (and sub-folders) and Sent Items;

New-MailboxExportRequest -IncludeFolders “#Inbox#/*”,”#SentItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Don’t Export Sent Items and Deleted Items;

New-MailboxExportRequest -ExcludeFolders “#SentItems#”,”#DeletedItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Export ALL Mailboxes to  PST

[box]foreach ($Mailbox in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $Mailbox -FilePath “\\{server-name}\{folder-name}\$($Mailbox.Alias).pst” }[/box]

Related Articles, References, Credits, or External Links

Exchange 2000 / 2003 – Exporting Mail to .pst files with ExMerge

Exchange (2010 Post SP1 and Newer) Bulk Importing Mail From PST Files

Adding Rights to Public Folders (Recursively)

KB ID 0001598

Problem

After a recent Exchange migration (2007 > 2013 > 2016), I had problems with users not being able to see public folders, one user could see them all, (so I know they were present and correct, content wise,) but other users could not even see them.

Normally in this situation I’d test them in Outlook Web App first, if they work there then look at Outlook, but Public folders just didn’t work in Outlook Web App 2016 at all.

My first task was to check/set the permissions of the public folders, the one user who could see them was set as ‘Owner‘ on the root of the public folders, so my first step was working out how to grant myself these rights, and apply all those rights to all the child public folders below?

Note: Granting a user ‘Owner‘ rights at the root has obvious security implications, in your scenario you might want to choose ‘Reviewer’, or some other level of access.

View Existing Public Folder ‘Root’ Permissions

Simply use the following PowerShell in the Exchange Management Shell;

[box]

Get-PublicFolderClientPermission "\"

[/box]

If you just wanted to check for one user, then do this instead;

[box]

Get-PublicFolder -Identity "\" -Recurse | Get-PublicFolderClientPermission | Where-Object { $PSItem.User -like "SURNAME*" }

[/box]

Note: If you are working on a particular ‘child’ Public Folder the the syntax is “\FOLDER NAME“.

Granting Public Folder Rights Recursively

Use the following PowerShell in the Exchange Management Shell

[box]

Get-PublicFolder -Identity "\" -Recurse | Add-PublicFolderClientPermission -User pete.long -AccessRights Owner

[/box]

It complains and says this user already has rights? If this happens then Recursively Remove all rights then re-execute the command above.

Removing Public Folder Rights Recursively

Use the following PowerShell in the Exchange Management Shell

[box]

Get-PublicFolder -Identity "\" -Recurse | Remove-PublicFolderClientPermission -User pete.long

[/box]

Related Articles, References, Credits, or External Links

NA