Exchange 2013 Pre-Installation Steps

Below are some Pre-Installation steps when installing Exchange 2013.
1. Prepare Active Directory Schema for your install of Exchange 2013.
2. Install the Windows Features and then restart.

Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation

3. Install these software packages and Reboot:
a. Unified Communications Managed API 4.0 Runtime
b. Microsoft Office 2010 Filter Pack 64 bit
c. Microsoft Office 2010 Filter Pack SP2 64 bit

4. Proceed with the install of Exchange 2013.

Clearing out a corrupt transport queue.

MSExchange Transport Service will not start. Application eventlog has logged Source ESE, EventID 529 with this in the details. bytes failed verification due to a corrupted checksum log record. The read operation will fail with error. If this condition persists, restore the logfile from a previous backup.

Stop the MSExchange Transport Service

Go to C:Program FilesMicrosoftExchange ServerV14TransportRolesdataQueue (if installed in default location)

Create New folder OLDQueue,

Move all files in the Queue folder to new OLDQueue folder.

Start the MSExchange Transport Service

A new database will be created and your queue will be cleared.

Exchange Queue Error: 451 4.4.0 dns query failed. the error was dns query failed with error ErrorRetry

Scenario:  You receive complaints that users are experiencing the following symptoms with their Exchange 2013 mailbox:

  • Outlook:  Messages are getting stuck in the OutBox when sending
  • OWA: Messages are getting stuck in the Drafts Folder when sending

During investigation, you run this command: get-queue -server ExMbx1 | FL Identity, Status, MessageCount, LastError and find all of the queues on that transport server have a high MessageCount and this LastError:  451 4.4.0 dns query failed. the error was dns query failed with error ErrorRetry

You have verified your DNS settings on the network adapter are correct and you were successful at using NSLOOKUP to resolve the MX record of one of the domains that you are having trouble with (instructions below on how to do this).

NSLOOKUP instructions:
1. From command line, type nslookup
2. set q=mx    (or  set type=mx)
3. domain.com

Cause:  Exchange transport service allows you to set and use external and internal dns servers different from network card dns settings. Internal DNS server setting was pointing to dns servers that were decommissioned

Solution:  Remove the custom DNS entries in Exchange. This makes Exchange use the network adapters DNS. Follow the steps below to resolve via EAC or PowerShell

Via EAC:
1. Once in EAC/ECP, navigate to Servers and open the server properties.
2. Click on DNS Lookups.
3. Make sure the Internal and External DNS lookups are set correctly.  The internal and External DNS settings need to match DNS setting on the network card IP configuration. Type the current DNS settings or leave it blank. Blank forces Exchange transport service to use network card DNS setting

Via Shell:
1. Use get-transportserver ExMbx1 | FL *DNS* to verify your settings.
2. You want to use the set-transportserver command to set it back to all network adapters or change the custom IP Range.

For Example:  You may wish to change the Internal DNS to use all network adapters and not custom by running:
set-transportserver ExMbx1 -InternalDNSProtocolOption Any

OR type the following to set it to Null

set-transportserver ExMbx1 -InternalDNSServers $null

Add a new email address to mailboxes in bulk

This one liner reads a list of user names from a text file, fetches the current set of proxy email addresses, and adds a new “test.com” SMTP email address to each mailbox.

Get-Content Users.txt | Get-Mailbox |% {$_.EmailAddresses.add(“smtp:$($_.SamAccountname)@test.com”); Set-Mailbox -Identity:$_.Identity -EmailAddresses:$_.EmailAddresses}

Block Activation of Database Copies on an Exchange Server

Scenario:  We need to block database copies on a server from Activation as these servers are being worked on.  Activation is the process of changing a mailbox database copy from a passive copy to an active copy. Activation occurs automatically by the system as part of a database or server failover operation, and it can be performed manually by an administrator as part of a database or server switchover operation. Blocking a database for activation prevents it from becoming the active copy during a database or server failover.

Run the following command to block activation:

For a single server:  
Set-MailboxServer -identity MBX1 -DatabaseCopyAutoActivationPolicy Blocked

For multiple Servers (One liner)
Get-MailboxServer MBX* | Set-MailboxServer -DatabaseCopyAutoActivationPolicy Blocked

Run the following command to unblock activation:

For a single server:  
Set-MailboxServer -identity MBX1 -DatabaseCopyAutoActivationPolicy Unrestricted

For multiple Servers (One liner)
Get-MailboxServer MBX* | Set-MailboxServer -DatabaseCopyAutoActivationPolicy Unrestricted



Reference

Cant delete message in OWA.
Error: Access is denied.
Solution: Insure EWS is enabled on mailbox

In Exchange Powershell run
         get-casmailbox mailboxname |select ewsenabled
if       EwsEnabled                 : False

then enable by running the following command.
         set-casmailbox mailboxname -ewsenabled $true

Removing Bulk Exchange Mailboxes via Powershell

Scenario:  You have a list of mailboxes that you wish to remove in bulk.

Resolution:  We will use the Remove-Mailbox command-let in order to perform this task.  We will remove it via a loop by reading in a CSV file with the mailboxes.  Note:  The Remove-Mailbox will disable the mailbox and delete the AD account.  If you wish to leave the AD Account but only disable the mailbox, use the Disable-Mailbox instead.

Create a CSV file with the names of the mailboxes
  1. Open Notepad
  2. On the first line, type in name
  3. On the second line and down, paste the mailbox names (one mailbox per line).
  4. Save it as Mailboxes.csv to a location you will remember

Import the CSV into a Exchange Variable
  1. Open Exchange Management Shell
  2. Type in the following: (Make sure to use the .csv file path from above)
       $mailboxes = Import-Csv ‘C:mailboxes.csv’
  3.  Verify that your Exchange Variable has content by typing in:
       $mailboxes

Remove the Mailboxes via a loop in Exchange Management Shell.
  1. Type in the following:
       $mailboxes | %{Remove-mailbox $_.name -confirm:$false }
  2. The Mailboxes and AD objects are now removed.

Alternate Methods:

1. Remove a Single Mailbox:    
     Remove-Mailbox jdoe1 -confirm:$false
2. Remove multiple mailboxes that follow a pattern in the mailbox name quickly:
     Get-mailbox jdoe* | Remove-mailbox -confirm $false

     

Gathering Mailbox Counts in Exchange

Scenario:  You need to gather Mailbox Counts in your Exchange Environment.  You need to gather these types of counts: Total Mailboxes in your Exchange Organization, Total Mailboxes per Server, and/or Total Mailboxes per Database.

Run the following:
1. Total Mailboxes in the Exchange Organization
(Get-mailbox -resultsize unlimited).count

2. Total Mailboxes per Mailbox Server
Get-Mailbox -resultsize unlimited | Group-Object -Property:ServerName | Select-Object Name,Count

3. Total Mailboxes per Database
Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | Select-Object Name,Count

If you know specific information for the server or database,  you can run the following:

Server:  (Get-MailboxServer MBX01| Get-mailbox -resultsize unlimited).count
Database:  (Get-MailboxDatabase DB01 | Get-mailbox -resultsize unlimited).count

You receive the following error when trying to import a pst file with a large message to an Exchange mailbox.

Error: This mailbox exceeded the maximum number of large items that were specified for this request.
Solution: Raise the -LargeItemLimit size above the default 35mb.

Example:
New-MailboxImportRequest -Mailbox Ben -LargeItemLimit 50 -AcceptLargeDataLoss -FilePath serverben.pst

You can’t search for admin audit log entries because the arbitration mailbox for the organization is located on a server that doesn’t have Exchange 2013 installed.

Issue: You can’t search for admin audit log entries because the arbitration mailbox
‘SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}’ for the organization ” is located on a server that doesn’t have Exchange 2013 installed. The mailbox must be moved to an Exchange 2013 server before you can search for admin audit log entries.
Resolution: Move arbitration mailbox to Exchange 2013
Get-Mailbox -Arbitration -Identity “SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}” | New-MoveRequest -TargetDatabase <name of Exchange 2013 database>