Exchange SP2 Upgrade

The instructions below will guide you though the SP2 upgrade for Exchange 2010.

Perquisites:

  • Make sure all users have been logged off the server before proceeding with the upgrade.  If an employee is logged into the server you may receive an error or similar to:
    “Setup cannot continue with the upgrade because the ‘mmc’ (7060) process (ID: ) has ‘Microsoft.EnapIn.Esm.dll’ loaded. Close the process and restart setup.” 

    Take note of the process ID number 7060 listed above.  Open task manager and end task the application with the same process ID.  You may then restart the SP2 installation.

  • Do Not use the EMS (Exchange management Shell) for the upgrade.  If you do the installation will fail with a similar error to the one listed above.
    _
  • If you are running a DAG on the Mailbox role please failover the database(s) before proceeding with the upgrade.

Installation Instructions:

  1. Confirm the “Windows Management Instrumentation” service is set to Automatic and is currently started.
    _
  2. Open PowerShell in administrator mode and enter:

    “ServiceControl.ps1 AfterPatch”If an error is returned please enter the cmd listed below:
    “Set-ExecutionPolicy RemoteSigned” and then run the “ServiceControl.ps1 AfterPatch” cmd.
    _
  3. Confirm the Execution policy is set to “Undefined” by entering the following CMD:
    “Get-ExecutionPolicy -list”
    _
    If an ExecutionPolicy has a setting other then “Undefined” please enter the following CMD:
    “Set-ExecutionPolicy Undefined”
  4.  Navigate to the Exchange SP2 directory to begin the SP2 upgrade and then enter following CMD:
    “Setup /Mode:Upgrade /InstallWindowsComponents”
    ([http://technet.microsoft.com/en-us/library/hh529928.aspx])
    _
  5. After the installation has completed please proceed to with the installation of Rollup 2 by using powershell in administrator mode.  Then execute the following msp file “Exchange2010-KB2661854-x64-en.msp”
    _
  6.  After the installation has completed please restart the server.

Exchange IIS Redirect Error

You received the error listed below after browsing to https://exchange-srv-fqdn/exchange

Server Error in ‘/’ Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a “web.config” configuration file located in the root directory of the current web application. This tag should then have its “mode” attribute set to “Off”.

<!– Web.Config Configuration File –><configuration><system.web><customErrors mode=”Off”/>

</system.web>

</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the “defaultRedirect” attribute of the application’s configuration tag to point to a custom error page URL.

<!– Web.Config Configuration File –><configuration><system.web><customErrors mode=”RemoteOnly” defaultRedirect=”mycustompage.htm”/>

</system.web>

</configuration>

Image of the error listed above:


To resolve this error follow Microsoft directions on “How to recreate the legacy Exchange Virtual Directories in Exchange 2010?”.  If that does not resolve the problem than open the web.config file located on the CAS server’s “C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa”.  Search for:

<httpRedirect enabled=”false”

Then delete the entire line.  Save the web.config file and test it again.  This problem is caused because the web.config file is overriding the settings located on the applicationHost.config file listed in the MS link above.  Below is a quick video showing the issue and resolution.  Hope that helps.


VMware vSphere – Insufficient video RAM

Issue:  Insufficient video RAM.  The maximum resolution of the virtual machine will be limited to….

Solution:  according to VMware no action is required.  However, if you like to get rid of the error please follow VMware’s instructions in KB article 1024990.


vSphere – Disks Consolidation is needed

Issue: Configuration Issues Virtual machine disks consolidation is needed.

This error may appear if the snapshot deletion process for a virtual machine did not complete successfully.  In previsions version that meant resolving this using the command line.  In vSphere 5 you can use the UI.

 

Resolution:

  1. Right click on the VM, highlight Shapshot and then click on Consolidate.
  2. Click Yes to confirm.

Depending on the size of the snapshots, this process can take some time before completing.

http://kb.vmware.com/kb/2003638


DFS Error

If you enter counter the DFS error:

“\\domain.com\namespace: The namespace cannot be queried. Access is denied”

then run the following command:

“dfsutil /clean /server:servername /share:sharename /verbose”

That should have resolve your problem.  If not then look at the following Microsoft KB:

http://support.microsoft.com/kb/977511


Mailboxes not logged into within the last 30 Days

Below is a powershell command that will return all mailboxes not logged into within the last 30 days:

Get-MailboxStatistics -Database “Server\Database” | where {$_.LastLogonTime -lt (Get-Date).AddDays(-30)} | ft DisplayName, LastLogonTime, LastLoggedonUserAccount, Servername


Retrieving Disconnected Mailboxes from an Exchange Server

The command below will retrieve disconnected / deleted mailboxes from a given Exchange server using Powershell.

Get-MailboxStatistics -Server <server> | where { $_.DisconnectDate -ne $null } | Select Displayname, DisconnectDate, TotalItemSize -Autosize

Below is a Powershell command to retrieve disconnected mailboxes for the last 7 days:

Get-MailboxStatistics -Server corp2k7mail | Where-Object {$_.DiscconnectDate -gt (Get-Date).AddDays(-7)} |ft Displayname, ServerName, DatabaseName, TotalItemSize –Autosize

To reconnected a disconnected mailbox to a user object still in AD type:

Connect-Mailbox -Database <Mailbox_Database> -Identity <Deleted_Mailbox>


Determining Exchange’s Database Size

An easy way to determine the Exchange’s actual database size is to look for Event ID 1221 under Windows application logs.  For example, If the database size is 100gigs and event 1221 is reporting 30000 megabytes free space; then your actual database size is 70gigs.  As a result, you can compact the database to 70gigs from 100gigs if you ran an offline defragmentation on the database.


ADComputer Powershell Cmd’s

Have you ever had to produce a report on what service pack your computer/servers have installed? Or, the location of the computer’s OU?  Or a list of your servers IP’s?  Below are sample powershell cmd using ADComputer.

Let’s start with the basic: To get powershell examples, help type:

Get-help Get-ADComputer -examples

Now let’s look at a computers properties:

Get-ADComputer <ComputerName> -Properties *

This will produce all the active directory attributes relate to the computers on the left and the information of those attributes on the right (image below).  This information will be used to fill in the -properties information for the powershell cmds listed below.

Below is one of the Get-help examples provide to us:

Get-ADComputer -Filter ‘Name -like “Fabrikam*”‘ -Properties IPv4Address | FT Name,DNSHostName,IPv4Address -A

The command listed above will return the computers Name, DNShostname, and IP address.  Let’s change this command to show us the computer’s name, operating system, and service pack.

Get-ADComputer -Filter * -Properties Name, Operatingsystem, OperatingSystemServicePack | FT Name, OperatingSystem, OperatingSystemServicePack

Now let’s filter the command to show us only servers.  The command listed below will search for the word “server” in the operating system column and then display that information:

Get-ADComputer -Filter ‘Operatingsystem -like “*server*”‘ -Properties Name, Operatingsystem, OperatingsystemServicePack | FT Name, OperatingSystem, OperatingSystemServicePack

Let’s sort the information listed above by operating system and then by name:

Get-ADComputer -Filter ‘Operatingsystem -like “*server*”‘ -Properties Name, Operatingsystem, OperatingsystemServicePack | Sort-Object OperatingSystem, Name | FT Name, OperatingSystem, OperatingSystemServicePack -AutoSize

If you notice we made minor changes to customize the powershell cmd to provides us with the information we needed.


Exchange DB and Mailbox Total Count

I was recently ask to provide the total number of Exchange mailboxes.  Simple question, but I notice one of my co-workers working on a powershell cmd to retire the data.  Below is the powershell cmd that would retire that data:

 (Get-Mailbox).count

Or, just open the Exchange Management console click the Mailbox icon located under the Recipient Configuration.  Then look at the total number of objects located at the top right corner.

But, what about the total number of Exchange databases:
(Get-Mailbox -ResultSize:Unlimited | Group-Object -Property:Database).count

The powershell cmd below returns all of the databases names:
(Get-Mailbox -ResultSize:Unlimited | Group-Object -Property:Database | Select-Object -Property:Name)

The powershell cmd below returns total mailbox count per database and the database name:
(Get-Mailbox -ResultSize:Unlimited | Group-Object -Property:Database | Select-Object -Property:Count,Name)