Thursday, May 17, 2012

Call-ClusterExe: cluster.exe did not succeed, but 5058 was not a retry-able error code

You attempt to stop maintenance mode on an Exchange 2010 server using the StopDagServerMaintenance.ps1 script however you receive the following error.

WARNING: [02:57:24.640 UTC] Call-ClusterExe: cluster.exe did not succeed, but 5058 was not a retry-able error code. Not attempting any other servers. This may be an expected error by the caller.

The problem?

UAC.  Run Exchange managemnet console as Administrator.

Thursday, May 10, 2012

Exchange 2007 Uninstall hangs on Remove Exchange Files

Today I was decomissioning an Exchange 2007 server for a customer.  The uninstall process got down to "Remove Exchange Files" where it just hanged and did not proceed.  The environment was running Exchange 2007 SP2 on Windows Server 2008 Standard SP2.

After a quick search I found that I ran into a known uninstall issue. The hanging in removing the Exchange files is caused by a final Powershell script that won't run so instead of ending in failure it just hangs and gives the appearance that it is still processing the removal.

All you need to do is open task manager and kill powershell.exe.  Doing this will automatically spawn a new Powershell and allow the removal to complete.  In my situation, the removal completed within 10 seconds of the new Powershell launching.

Caution with Remove-PublicFolder cmdlet

Today I had ran into some trouble at a client with the Remove-PublicFolder cmdlet in Exchange 2010.  The Remove-PublicFolder cmdlet by default removes a public folder from all public folder databases within an Exchange organisation.

This example removes a public folder called "My Public Folder" from all public folder databases in an Exchange environment.

 Remove-PublicFolder -Identity "\My Public Folder"

If you want to remove "My Public Folder" on a specific Exchange server, you can do this with the following command:

Remove-PublicFolder -Identity "\My Public Folder" -Server Server01

If I want to list all public folders on a particular server I can do this with the following command:

Get-PublicFolder -Server Server01 -Recurse

Easy stuff right?  The problem I found however was with the following command:

Get-PublicFolder -Server Server01 -Recurse | Remove-PublicFolder

Here I piped the output of the Get-PublicFolder command to the Remove-PublicFolder command.

Get-PublicFolder -Server Server01 -Recurse displays a list of all public folders on Server01.  When piped into the Remove-PublicFolder command the Remove-PublicFolder command removes the public folders on all servers even though I only specified Server01.  The pipe between the commands does not have the logic to pipe through the server I selected in the Get command, something which other Exchange cmdlets do.  Definately a gotcha and something to watch out for.

To ensure this problem does not happen, you must specify which server you are removing public folders for on the Remove-PublicFolder cmdlet.  For example:

Remove-PublicFolder -Identity "\My Public Folder" -Server "My Server"

Hopefully this will avoid you restoring from backup as I found myself doing today.

Thursday, May 3, 2012

Unable to Delete Email from Outlook Web App 2010

A customer of mine cannot delete emails from Outlook Web App (OWA) 2010.  The customer is running Exchange 2010 SP2 with UR1.  When deleting an email the following error is experianced in OWA:

An unexpected error occured and your request couldn't be handled.



Also whenever the error occurs in Outlook Web App the following errors are logged to the Application Log of the server.

Outlook Web App couldn't connect Exchange Web Services due to a configuration error. Response code = "500".


WebHost failed to process a request.
 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/20974680
 Exception: System.ServiceModel.ServiceActivationException: The service '/EWS/exchange.asmx' cannot be activated due to an exception during compilation.  The exception message is: A binding instance has already been associated to listen URI 'http://tst-dc1-cas-1.tsthosting.local/EWS/Exchange.asmx'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config. . ---> System.InvalidOperationException: A binding instance has already been associated to listen URI 'http://tst-dc1-cas-1.tsthosting.local/EWS/Exchange.asmx'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
   --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
 Process Name: w3wp
 Process ID: 4516



After investigating I found the problem was with Exchange Web Services in the web.config file located under:

C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\exchweb\ews

This particular client had an F5 Load Balancer and required that SSL Offloading was configured in the Exchange environment.  We had followed Microsoft's instructions for configuring SSL offloading on Exchange 2010 which are documented here:

http://social.technet.microsoft.com/wiki/contents/articles/1267.how-to-configure-ssl-offloading-in-exchange-2010-en-us.aspx

This article instructs customers to do a find and replace on the EWS web.config file to replace all instances of "httpsTransport" with "httpTransport".  However as of Exchange 2010 SP1 the web.config file contains both the httpTransport and httpsTransport settings in the XML configuration file so this is no longer required.

I went back and changed the httpTransport occurances to httpsTransport to ensure the config file accomodated both HTTP and HTTPS.

Tuesday, May 1, 2012

Postfix and Exchange Intergration

A client of mine decided to use Postfix as a SmartHost for Exchange 2010.  This Exchange environment is to be setup as a multi-tenant Exchange environment and as a result the Postfix servers need to understand which SMTP domain namespaces are authoritative within the Exchange environment.  As a result we needed to configure the Linux Postfix server to query Active Directory to determine a list of "Accepted Domains" within Exchange 2010 which are located under the following location within the Active Directory schema.

CN=Accepted Domains,CN=Transport Settings,CN=TSTHOSTING,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local

The linux distribution used for this config is Ubuntu.

Software packages required:
  • postfix
  • postfix-ldap
  • ldap-utils
  • libldap-2.4-2
apt-get install postfix-ldap will automatically install all required packages.

A seperate configuration file was put together called ad_relay_domains.cf which we placed under /etc/postfix/ad_relay_domains.cf

server_host = 192.168.1.2
server_port = 389
version = 3
bind = yes
start_tls = no
bind_dn = Administrator
bind_pw = MyPassw0rd (__mailto:MyPassw0rd)
search_base = cn=Accepted Domains,cn=Transport Settings,cn=TSTHOSTING,cn=Microsoft Exchange,cn=Services,cn=Configuration,dc=domain,dc=local
scope = sub
query_filter = (msExchAcceptedDomainName=%s)
result_attribute= msExchAcceptedDomainName

  • Server_Host enter the IP address of an AD Domain Controller
  • Server_Port needs to be the standard port for LDAP
  • version must be 3
  • Bind, yes we are creating an LDAP bind.
  • Start_TLS, we are not using a digital certificate on Active Directory (pretty standard).  TLS is more common with AD LDS/ADAM Instances as they are not protected using Kerberos v5.
  • bind_dn enter the user account you wish to bind to Active Directory with.
  • bind_pw is the password that goes with the user account specified under bind_dn.  You must enter it in "password (__mailto:password)" format.
  • search_base is the location in Active Directory where Exchange 2010 stores its accepted domains.
  • scope specifies all sub objects
  • query_filter is the attribute on the accepted domain objects we wish to query.
  • result_attribute is the attribute we are interested in the query result.
This file that contains the above config /etc/postfix/ad_relay_domains.cf must be called from the main Postfix configuration file main.cf.  To call the config we simply need to enter the following symtax into the main.cf file:

relay_domains = _ldap:/etc/postfix/ad_relay_domains.cf

Credits for this solution go to Daniel Borg.