Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > EXCHANGE SERVER (TECHNET) > Verifying existence of a mailbox for a given username
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 2nd August 13:06
michael mcgranahan
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username



Hello,

What is the best/correct way to verify the existence of a mailbox for a
given username without using ADSI? I am building a web service that
interfaces with Exchange 2003. The client supplies the username (and
other data) in calls such as CreateAppointment and
GetListOfAppointments. I am restricted for business reasons from
interfacing directly with ADSI. How can I validate the username?
Should I simply try to open the HTTP resource (e.g.
"http://localhost/exchange/joe") and catch exceptions when the resource
doesn't exist? Does CDOEXM provide relevant functionality?

Thanks for your help.

--
Michael McGranahan
Programmer/****yst
College Information Services, UCLA
  Reply With Quote


  sponsored links


2 2nd August 13:13
henning krause mvp - exchange
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username



Hello,

you can use the OWA galfind.

While this is not do***ented and subject to change in future version of
Exchange, it will certainly work with Exchange 2003. Then FN= parameter ist
the firstname.

You can use Fiddler to the parameters of the other options.

OWA uses this feature when adding recipients to an email.

GET /exchange/username/?Cmd=galfind&FN=%73%74%65%66%61%6e HTTP/1.1

Be sure to fake the IE useragent string to get the proper response from the
Exchange server.

Best regards,
Henning Krause
  Reply With Quote
3 2nd August 13:15
michael mcgranahan
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hi,

Thanks for your help. On what other parameters can the search be
performed? I am not given the first name, only the username (or alias).

To clarify, I'm using ADO with the ExOLEDB driver to add/modify/remove
appointments in an Exchange store. None of the relevant sample code
demonstrates how to check if a mailbox in particular (or any arbitrary
path in the Exchange store, generally speaking) exists before attempting
to open a connection to it. Or is it recommended to just handle the
exception that is thrown when attempting to open a resource that doesn't
exist?

Thanks again,
Michael

--
Michael McGranahan
Programmer/****yst
College Information Services, UCLA
  Reply With Quote
4 2nd August 13:15
henning krause mvp - exchange
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hello Michael,

to search for an alias, use this command:
GET /exchange/hkrause/?Cmd=galfind&AN=<name> HTTP/1.1

As I said before, you can easily get this information when you use Fiddler
(http://www.fiddlertool.com).

Greetings,
Henning Krause
  Reply With Quote
5 2nd August 13:16
michael mcgranahan
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hi Henning,


I looked at the Fiddler tool and it wasn't clear how to make it expose
all of the possible parameters to galfind; indeed I don't think it's
possible using Fiddlers as that is not Fiddler's purpose.

Additionally, I cannot find do***entation regarding the use of Fiddler
to access resources protected by HTTP authentication, as are all
non-public OWA resources.

Lastly with regards to Fiddler, I need to implement username-validation
programatically in my web service. I cannot have someone watching the
web service requests, and using Fiddler to create custom HTTP messages
to validate the usernames.

Thank you for your reply.

Michael
  Reply With Quote
6 2nd August 13:16
henning krause mvp - exchange
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hello Michael,

Fiddler is simply a HTTP proxy. Assuming you have access to your OWA using
HTTP only, you can check what OWA is doing in the background (I have a
virtual machine with Exchange on it for such testing...). To get those
commands you want, start fiddler and then connect to OWA with Internet
Explorer. Compose a new mail and click on the "To" button. This will open
the window to search the GAL. Enter a name in the alias field and press
"Search". Now, when you switch back to Fiddler, you can scan through the
requests and see what OWA is doing. This yielded the requests I posted
earlier.


Of course. I never wanted you to watch over the requests... It's just a tool
to get the actual command - now you can use that command and do your own
request.

Best regards,
Henning Krause
  Reply With Quote
7 2nd August 13:17
michael mcgranahan
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hi Henning,

Thank you for explaining, I understand now. I appreciate your help.

Michael


--
Michael McGranahan
Programmer/****yst
College Information Services, UCLA
  Reply With Quote
8 2nd August 13:17
michael mcgranahan
External User
 
Posts: 1
Default Verifying existence of a mailbox for a given username


Hi,

The AN parameter to galfind unfortunately will not match secondary email
addresses added to a user account through the Active Directory Users and
Computers MMC snap-in (right click a username, choose E-mail Addresses
tab, click New, choose SMTP address, enter a username without the host
part). Exchange treats these email addresses as aliases to the primary
address, and they are accessible through CDO. Is there a way to check
the validity of these "alias" usernames?

Michael


--
Michael McGranahan
Programmer/****yst
College Information Services, UCLA
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666