Archive for the ‘Exchange’ Category

Export Mailbox into a PST from Exchange 2010

March 15, 2017 Leave a comment

Below are the commands required to export mailbox and save in PST format.

# Give permissions to user doing the export

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

# Create Network Share and give permissions to Exchange Trusted Subsystem read/write

# Start the Mailbox Export

New-MailboxExportRequest -Mailbox first.surname -FilePath \\comp\share

# Start mailbox export with archive

New-MailboxExportRequest -Mailbox first.surname -FilePath \\comp\share -IsArchive

# Check the status of mailbox export request



Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

# When Mailbox export request has been finished. Remove it

Get-MailboxExportRequest | Where {$_.status -eq "Completed"} | Remove-MailboxExportRequest



Command to List Mailbox Sizes in Exchange 2010

March 14, 2016 Leave a comment

Here’s the command that lists the Mailboxes by Size and exports it to CSV:

Get-MailboxStatistics -Database "Mailbox Database XXXXXXXXXXXXX" | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV C:\MBSizes.csv



Invisible Send Connector Exchange 2010

March 9, 2016 Leave a comment

Made a small discovery the other day. Next to the visible Receive and Send Connectors, there are also Invisible Send Connectors available on the Exchange server. The one I found is called Intra-Organization Send Connector, which is used to transport messages within the organisation, between the Hub transport serves, Edge Transport Server and old Exchange servers. It is not visible in the console or when you use Get-SendConnector command.

Here’s the command to configure protocol logging for Intra-Organization Send Connector:

Set-TransportServer “TRANSPORT SERVER NAME” -IntraOrgConnectorProtocolLoggingLevel verbose


Recover deleted emails on Exchange Online / Office 365

March 6, 2016 Leave a comment

I have separated this into multiple steps.

  1. Create a session to Exchange Online
  2. Find the users mailbox and locate the deleted emails
  3. Move the deleted emails to the users mailbox
  4. Permissions to do steps 2 and 3


  1. Create a session to Exchange Online
    • Enter User Credentials

      $Office365Cred = Get-Credential

    • Create the session

      $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri `
      -Credential $Office365Cred -Authentication Basic –AllowRedirection

    • Import the session

      Import-PSSession $Session

  2. Find the users mailbox and locate the deleted emails

    • Find the users mailbox from the list, skip if you know the user


    • Look for deleted emails

      Search-Mailbox “Charlotte Smith” -SearchQuery “to:’Martyn Dawson'” -TargetMailbox “Discovery Search Mailbox” -TargetFolder “Charlotte Smith Recovery” -LogLevel Full

      TIP!If the Search-Mailbox command is not available (you will get an error)  you are missing Discovery Management role. Go to Step 4

  3. Move the deleted emails to the users mailbox
    • Recover deleted emails

      Search-Mailbox “Discovery Search Mailbox” -SearchQuery “to:’Martyn Dawson'” -TargetMailbox “Charlotte Smith” -TargetFolder “Recovered Messages” -LogLevel Full -DeleteContent

      TIP! – If the command gives you the error below you are missing Mailbox Import Export role. Go to Step 4
      A parameter cannot be found that matches parameter name ‘DeleteContent’.
      + CategoryInfo          : InvalidArgument: (:) [Search-Mailbox], ParameterBindingException
      + FullyQualifiedErrorId : NamedParameterNotFound,Search-Mailbox
      + PSComputerName        :

  4. Permissions to do steps 2 and 3.
    • Use the command below to give your admin account the missing “Discovery Management” Role permissions

      Add-RoleGroupMember -Identity “Discovery Management” -Member

    • Check your admin accounts membership

      Get-RoleGroupMember -Identity “Discovery Management”

    • Use the command below to give your admin account the missing “Mailbox Import Export” Role permissions
      Create a new Role Group

      New-RoleGroup “Mailbox Import-Export Management” -Roles “Mailbox Import Export”

    • Give Permissions to your admin user

      Add-RoleGroupMember “Mailbox Import-Export Management” -Member

    • Check your admin accounts membership

      Get-RoleGroupMember -Identity “Mailbox Import-Export Management”

      TIP! – You need to restart the session after adding the permissions.



Understanding Exchange 2013 Server Roles in the Simplest way

March 5, 2016 Leave a comment

I found this simple explanation on TechNet by accident. My thanks and credit goes to the authors ( AshwinXADM and Thomas Stensitzki).

Exchange 2013 Server Roles

Exchange 2013 has three Roles:

  • Mailbox Server Role
  • Client Access Server Role
  • Edge Server Role

Each organization requires minimum one Mailbox Server Role and Client Access Server Role. The Edge Server Role is optional and is placed in the perimeter network.

Mailbox Server Role Includes:

  • Client Access Protocols
  • Transport Service
  • Mailbox Databases
  • Unified Messaging (Except SIP Redirection)
  • Handles all activities for active Mailboxes on that Server

Client Access Server Role Includes:

  • Authentication
  • Redirection (limited)
  • Proxy Services for HTTP, POP, IMAP and SMTP
  • Thin and Stateless Server
  • Does not do any data rendering
  • Nothing is queued or stored here (except diagnostic logging)

Edge Server Role includes:

  • Transport Service
  • Address Rewriting
  • Anti-Spam and Anti-Malware filtering
  • Attachment filtering


Exchange ActiveSync Error

March 5, 2016 Leave a comment

Here’s how to fix the Exchange ActiveSync error Event ID: 1053.

Exchange ActiveSync doesn’t have sufficient permissions to create the "CN=John Doe,OU=Random users,OU=Users,OU=Random OU ,OU=Random Sites,DC=random,DC=com" container under Active Directory user "Active Directory operation failed on This error is not retriable. Additional information: Access is denied.
Active directory response: 00000005: SecErr: DSID-031521D0, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0

Make sure that the user has inherited permission granted to domain\Exchange Servers and right to allow List, Create child, Delete child of object type "msExchActiveSyncDevices" and doesn’t have any deny permissions that block such operations.


Open the User properties in Active directory and take away the permissions for the object in question and then add it again. This should fix the problem.

Another solution is available on Microsoft Support


Anti-Spam Agents on Excahgne 2013

March 4, 2016 Leave a comment

In Microsoft Exchange Server 2013, the following anti-spam agents are available in the Transport service on Mailbox servers, but they are not installed by default:

  • Content Filter agent
  • Sender ID agent
  • Sender Filter agent
  • Recipient Filter agent
  • Protocol Analysis agent for sender reputation

MORE INFO at TechNet – Link1, Link2


Categories: Exchange Tags: