views:

456

answers:

2

I am getting an error when trying to connect to an Exchange server using the cfexchangeconnection tag. First some code:

<cfexchangeconnection action="open" 
    server="****"   
    username="****" 
    password="****"
    connection="myEX" 
    protocol="https"
    port="443">

I know its the right server because it fails when not processing via https. I have tried:

The error I get is:

**Access to the Exchange server denied.**

Ensure that the user name and password are correct.

Any ideas

+1  A: 

Here's an idea - this is what I needed to do to make my cfexchange connection work. Not entirely sure if it's the same problem. I think I had a 440 error, rather than your 401 error.

I'm using:

  • https
  • webdav
  • forms based auth
  • Exchange 2007
  • Coldfusion 8
  • Windows 2003 servers

Here's the connection string that worked for me. What was keeping my connection from working was the need for the formBasedAuthenticationURL. This is a poorly documented attribute by both Adobe and Microsoft.

<cfexchangeconnection action="open"
 username="first.last"
 password="mypassword"
 mailboxname="myAcctName"
 server="my.mail.server"
 protocol="https"
 connection="sample"
 formBasedAuthentication="true"
 formBasedAuthenticationURL="https://my.mail.server/owa/auth/owaauth.dll"&gt;

    <cfexchangecalendar action="get" name="mycal" connection="sample">
        <cfexchangefilter name="startTime" from="#theDate#" to="#theEndDate#">
    </cfexchangecalendar>

<cfexchangeConnection action="close" connection="sample">

Additional notes:

  • IIS and WebDAV are enabled on the target Exchange server.
  • The username and password you're using has the appropriate permissions for a WebDAV connection. (I'm not the Exchange admin, so I'm not sure what they are, but I think the account needs to be allowed to connect to OWA. - Please correct me if I am wrong.)

Optional: (don't use if you don't have to)

  • IF HTTPS is required, use the appropriate argument.
  • IF Forms Based Authentication is on in Exchange 2007 (as was my case), you'll have to work around it using the formBasedAuthenticationURL argument.

Not sure if that's it, but I hope it is!

Dan Sorensen
@Dan Thanks. This helped a great deal. I definitely am not using formBasedAuthentication. The error I get now has to do with NTLM: Failure authenticating with NTLM. This shows up in the ColdFusion Builder console but no where else.
Sam Farmer
In that case, when you figure out what NT permissions are required, could you document that here somewhere? It seems to be poorly documented. I'm sure that full Administrator would work, but none of us want to use that if we don't have to.
Dan Sorensen
Yes will post the solution when I find it...
Sam Farmer
Well the solution was to switch to Form Based Authentication and then use your code. Thanks Dan.
Sam Farmer
I'm glad to hear it worked! This was a struggle for me as well. I'd be grateful if you update this post with any future related tech notes. :-)
Dan Sorensen
A: 

@ Dan - your connection string is what I needed going from Exchange 2003 to 2007.

After I installed the new SSL I was getting 440... I was able to CFHTTP to to the server using https, but wasn't able to authenticate until I specified "DOMAIN\userid" in username and "userid" in mailboxname.

Thanks for this post! I'd vote you up but I don't have enough points. I honestly just joined to post this comment and give you props for saving me (what was sure to be) hours of trouble shooting!

  • Phive.
Phive