Tag Archives: exchange 2010

How to export mailboxes to PST in Exchange 2010

A new set of PST export cmdlets, introduced in Exchange 2010 SP1, make it easier for Exchange administrators to export primary and archive user mailboxes to Outlook Data Files (PST). Though not recommended for storing large amounts of enterprise data, Exchange administrators use the Outlook Data Files to back up individual user mailboxes in certain scenarios – such as an employee leaving the business. This can help meet regulatory compliance mandates without having to back up the entire database. Additionally, a PST file can serve as an easy destination for exporting user mailboxes from corrupt databases in order to later import them to a healthy one.

Which users are permitted to export mailboxes to PST?

All users, including administrators, need to be assigned Mailbox Import Export role in order to export mailboxes to PST. This can be done via the Exchange Management Shell. To assign Mailbox Import Export role to a user, run the following cmdlets in the Exchange Management Shell:

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User <user name>

For example:

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Administrator

lepide_1Figure 1.Assign Mailbox Import Export role to a user

To assign Mailbox Import Export Role to a security group, run the cmdlets:

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup <Security group name>

For example:

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup MailboxExportImportGroup

lepide_3
Figure 2. Assign Mailbox Import Export role to a security group

To check which users have the rights to export mailboxes, run:

Get-ManagementRoleAssignment -Role “Mailbox Import Export” | Format-List RoleAssigneeName

lepide_3Figure 3. Check for users who have the rights to export mailboxes

The location of destination PST

The destination PST file for the mailbox export needs to be in a shared folder that is accessible from Exchange. Share the destination PST folder and provide Read/Write permissions for the Exchange Trusted Subsystem over it.

How to export mailboxes to PST

Mailboxes are exported to PST by creating mailbox export requests. To create an export request for a user mailbox, run:

New-MailboxExportRequest -Mailbox <mailbox name> -FilePath <network share path to the target PST file>

lepide_4Figure 4. Export mailboxes to PST

Note: You can create as many requests as required; but a unique name need to be given for every request after the tenth one (after which Exchange will not generate unique names for requests). To name a request, use the parameter ‘–Name’.

To export an archive mailbox, use:

New-MailboxExportRequest -Mailbox -FilePath –IsArchive

Note: To include or exclude specified folders in the export, use –IncludeFolders or –ExcludeFolders parameter.

Getting the details

To get details about the mailbox request, run:

Get-MailboxExportRequest

lepide_5Figure 5. Get the details about mailbox export

A better way to export mailboxes to PST

Exporting mailboxes to PST using the Exchange Management Shell is not a quick process, and many IT teams find that it is not a viable method when faced with strict deadlines. Specialised Exchange recovery management solutions, like Lepide Exchange Recovery Manager, provide powerful PST export facilities and simplify the whole process of data recovery. Lepide Exchange Recovery Manager also works with all versions of Exchange to ensure maximum compatibility with your Exchange environment.

lepide_6
Figure 6. PST export options in Lepide Exchange Recovery Manager

The solution’s Export Mailboxes dialogue displays some of the important features included:

  • Select mailboxes to export in PST allows easy selection of one or more mailboxes for export
  • Filters provide granular filtering options that can be done according to a date range or item types
  • This solution allows users to browse for the destination, split the Outlook PST file and create Unicode PST

Getting user-friendly details about items, folders and mailboxes exported to PST

With Lepide Exchange Recovery Manager, getting item, folder, and mailbox details exported to PST is easy and the reports provided are simple to understand. The solution shows you information on the export operation, mailbox (es) exported, folders in the exported mailboxes and the messages in the exported mailboxes folders. The screenshot below shows a sample of the operation logs created when multiple mailboxes are exported to PST:

lepide_7Figure 7. Details about the mailboxes exported to PST

Conclusion

Microsoft Exchange (from 2010 SP1 onwards), uses a new set of cmdlets to facilitate exporting mailboxes to PST. The user that performs this operation must be assigned Mailbox Import Export role and the destination PST folder must be accessible from Exchange. If you’re looking for an easier and quicker way to export mailboxes to PST, Lepide Exchange Recovery Manger is a powerful, cost-effective and user-friendly option.

(174)

Fix Error 0x80041820 when searching through OWA

When searching through OWA you might end up with an error saying “The action couldn’t be completed. Try again later“, while users using Microsoft Outlook don’t have any issue.

You might also see the below errors in the event viewer

Log Name: Application
Source: MSExchangeIS Mailbox Store
Event ID: 9842
Task Category: Content Indexing
Level: Error
Description:
Function CISearch::EcGetRowsetAndAccessor detected that content indexing was disabled for database ‘‘ because of error ‘0x80041820’ from MSSearch.

Log Name: Application
Source: MSExchangeIS Mailbox Store
Event ID: 9877
Task Category: Content Indexing
Level: Error
Description:
Content Indexing function ‘CISearch::EcGetRowsetAndAccessor’ received an unusual and unexpected error code from MSSearch. Mailbox Database: Error Code: 0x80043629

This can be solved by doing the following steps

– Check the version of Exchange 2010 installed by running Get-ExchangeServer | Format-List Name, Edition, AdminDisplayVersion (So, version 14.2 is SP2, 15.00 is SP3. If you are still using SP1 I strongly recommend to upgrade to at least SP2).
– Download the correct Service Pack and extract it.
– Run Setup /PrepareAD and Setup /PrepareSchema.
– After this is done restart the services Microsoft Exchange Search Indexer and Microsoft Exchange Information Store.

If this doesn’t work, use the following steps

– Download the script Repair-ExchangeSearchSymlinks.ps1 from the Script Center and copy it to C:\Program Files\Microsoft\Exchange Server\v14\Scripts
– Open Exchange Management Shell and browse to the above folder.
– Run the script with ./Repair-ExchangeSearchSymlinks.ps1
– After this is done restart the services Microsoft Exchange Search Indexer and Microsoft Exchange Information Store.

One last step if this doesn’t work is to reset the indexer and start indexing of the database by doing

– .\ResetSearchIndex.ps1 [-force] []…
– You will receive an Event ID 109 when the rebuilding of the index starts for each database and an Event ID 110 for each database when the index rebuild has completed.
– After receiving Event ID 110 for each database, test to make sure search functions correctly with both OWA and Outlook operating in Online Mode.

(466)

How to: Delete and re-create the Exchange ECP Virtual Directory

To delete the ECP virtual directory of your Exchange server and re-create it from scratch, you can use the below to get the identity of the virtual directory.

get-EcpVirtualDirectory |fl

Use this to remove the virtual directory in question

Remove-EcpVirtualDirectory -identity "MYSERVER\ecp (Exchange Back End)"

Create the new virtual directory use the below

New-EcpVirtualDirectory -externalurl "https://outlook.mydomain.com/ecp" -internalurl "https://myserver/ecp" -Server "myserver.mydomain.local"

(15309)

How to: Remove duplicate items from Exchange Mailboxes using Powershell

During an Exchange migration you sometimes have the issues where users complain that there are duplicate entries of their calendar items. This is normal to happen and can be done directly from the server using Powershell . You will need to download the script here and then install Managed API 1.2 or later which can be downloaded here.

Remove-DuplicateItems.ps1 [-Mailbox] <String> [[-Type] <String>] [-Server <String>] [-Impersonation] [-DeleteMode <String>] [-Mode <String>][-WhatIf] [-Confirm] [<CommonParameters>]

The syntax is below:

-Mailbox is the name of the mailbox to process;
-Type determines what folders are checked for duplicates. Valid options are Mail, Calendar, Contacts, Tasks, Notes or All (Default);
-Server is the name of the Client Access Server to access for Exchange Web Services. When omitted, the script will attempt to use Autodiscover;
-When the Impersonation switch is specified, impersonation will be used for mailbox access, otherwise the current user context will be used;
-DeleteMode specifies how to remove messages. Possible values are HardDelete (permanently deleted), SoftDelete (use dumpster, default) or MoveToDeletedItems (move to Deleted Items folder).
-Mode determines how items are matched. Options are Quick, which uses PidTagSearchKey and is the default mode, or Full which uses a predefined set of attributes to match items, depending on the item class.

For this to work you need to setup the impersonation of the user which you will be running the script. This can be done as below for Exchange 2010

New-ManagementRoleAssignment -Name ImpersonationRole -Role ApplicationImpersonation -User administrator

-Name : Can be anything you put in, it’s just a name
-User: Is the user you will be impersonating as

On Exchange 2007 you can use the below command:

Get-ExchangeServer | where {$_.IsClientAccessServer -eq $TRUE} | ForEach-Object {Add-ADPermission -Identity $_.distinguishedname -User (Get-User -Identity User1 | select-object).identity -extendedRight ms-Exch-EPI-Impersonation}

More info on the script here

(9972)

How to: Manually purge Exchange server logs safely

Many had this problem when in crisis, one would need to purge the Exchange logs but ended up not doing it for the fact that it would be risky and not safe. One can manually and safely purge the Exchange logs with the below script. Open a command prompt and type the following.

Note: the m: would be your drive where the Exchange Mailbox databases are.

diskshadow
add volume m:
begin backup
create backup

At this moment, nothing will happen and after some time the screen will be populated. As soon as you see the prompt, enter the below.

end backup

After some time, you will see the space decreasing and the logs being purged. Although this works on Exchange 2010, it would be the same for Exchange 2007.

(2305)

How to: Connect Remotely to an Exchange Management Shell

Powershell is a great tool and sometimes you need to connect to your prefered Exchange server without opening a remote desktop on the server. To connect remotely to any Exchange Management Shell you need the following:

To connect to the server using the logged-in user type,

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://my-exchange-server/PowerShell/ -Authentication Kerberos

and then type

Import-PSSession $Session

If you want to connect to the server using specified credentials, type the following,

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://my-exchange-server/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session

That should connect you to the desired server… enjoy

(1166)

How to: Allow application to relay through Exchange server

When having applications to explicity relay mail inside or outside your network with Exchange server you might have some problems. This can be solved by creating a Receive connector in your Exchange infrastructure. This can be done as below:

Open Exchange Management Console
Navigate to Server Configuration and Hub Transport
Select the server
Right click on the Receive connector area
Select New Receive Connector
Enter the name for the connector
Select Custom
On the Local Network settings click Next
On the Remote Network setting enter the IP address or range from where the emails will be sent
Once created open the properties of the connector
Open the Permissions Group tab
Tick Anonymous Users and Exchange Servers
Open the Authentication tab
Tick Transport Layer Security (TLS)
Tick Externally Secured (for example, with IPSEC)

Try to send the email and there you have it.

(116571)

Fix: No mailflow due to 430 4.2.0 STOREDRV; mailbox logon failure error

You will notice that there is a problem with mailflow and on the Queue Viewer in your Exchange setup you will notice that the mailflow is stuck for a good number of messages. You will also notice that the error message is 430 4.2.0 STOREDRV; mailbox logon failure.

You can also see the event viewer showing the Event ID 1009 in the Application log: The Microsoft Exchange Mail Submission service is currently unable to contact any Hub Transport servers in the local Active Directory site. The servers may be too busy to accept new connections at this time.

This can be because that the Microsoft Exchange Transport Service and Microsoft Exchange Transport Log services are running with a user and not the Network Service or Local System.

To fix this, open the Services.msc and set both services to Log On As Network Service or Local System. Restart both services and mailflow should get moving.

(3544)