Ask a questionAsk a question
 

Answerhow to get the DN(distinguish name)

  • Tuesday, October 20, 2009 12:02 PMJacobHuang Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    In the interface EcDoConnectEx,the parameter szUserDN is in the form of "/0=Microsoft/OU=Site1/cn=Recipient/cn=John", my question is that How could I get the string by the exchange protocol. I mean that How can I get the string by calling some interface. Could anyone tell me which interface to call , in which protocol doc?
    Now I obtained the string by finding the string in the address book in my MS Outlook,and then hard coding into the program,but that is not  feasible.

    Thank you in advanced!

Answers

All Replies

  • Tuesday, October 20, 2009 2:10 PMJoeDoyle23 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    The user's DN is also stored in Active Directory as part of the user account.  The property you want is legacyExchangeDN.  That's probably the easiest way.
  • Tuesday, October 20, 2009 4:29 PMObaid FarooqiMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi JacobHuang:

    I have alerted Protocol Documentation Team regarding your question about distinguish name. A member of the team will be in touch soon.


    Regards, Obaid Farooqi
  • Wednesday, October 21, 2009 2:33 PMBrad Hards Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Jacob,

    This is done using the NSPI interface (which basically makes sense - its the name service, and you're looking for user name information). Check the MS-NSPI spec.

    In MS-NSPI, I'd suggest starting with Section 4, then reading section 3, then the applicable bits of Section 2 for whichever opnums you need to use.

    HTH.

    Brad
    • Proposed As Answer byBrad Hards Wednesday, October 21, 2009 2:33 PM
    •  
  • Wednesday, October 21, 2009 5:57 PMDominic Salemno MSFTMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Jacob Huang,

    Are you merely trying to obtain the string representation of the distinguished name (DN)? Or are you trying to change the DN?

    Dominic Salemno
    Senior Support Escalation Engineer

  • Thursday, October 22, 2009 1:44 AMJacobHuang Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am trying to obtain the  string representation of the distinguished name (DN),which is use in the EcDoConnectEx call.
    thank you !
  • Thursday, October 22, 2009 1:47 AMJacobHuang Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you!
    In the section 4,It said "It is assumed that the messaging client has established an RPC connection to the NSPI server", could you please tell How to connect to the NSPI server? By calling some interface?
    :-)
  • Thursday, October 22, 2009 1:47 AMJacobHuang Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you !I will try your method!
  • Thursday, October 22, 2009 3:44 AMJacobHuang Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Would you please tell how to get the property from the AD, if possible a Demo will be appreciated.It's better in C++.
    Or could you please recommend some website and other resources that is a guide. 
    I have view the "Retrieving a Legacy Exchange Distinguished Name with ADSI " in http://msdn.microsoft.com/en-us/library/ms992523(EXCHG.65).aspx, however, when I compile it ,there is something wrong:"Expression is of type 'ActiveDs.IADs', which is not a collection type." Could anyone tell how to translate the code into C++.
    Thank you in advanced! 
  • Monday, October 26, 2009 4:53 PMDominic Salemno MSFTMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Jacob Huang,

                                   

    Please refer to this MSDN Article entitled “Getting User Settings”: http://msdn.microsoft.com/en-us/library/dd633650.aspx.

     

    Your questions are more development/implementation centered, therefore your questions would probably be better answered on this forum:

    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads [Development on TechNet]

     

    In review of your question I have filed a request to possibly add some addition content in [M-OXPROTO] to cover your use case of discovering the distinguished name (DN).

     

    Dominic Michael Salemno

    Senior Support Escalation Engineer

    US-CSS DSC Protocols Team

  • Monday, October 26, 2009 10:12 PMBrad Hards Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Dominic,

    If you want to see how the OpenChange project does it, you can look at our code for mapiprofile.c and IProfAdmin.c. You may not be able to use it directly (because we assume some underlying DCE RPC functionality from the Samba project, but you should still be able to get the idea.

    http://websvn.openchange.org/filedetails.php?repname=openchange&path=%2Ftrunk%2Futils%2Fmapiprofile.c
    http://websvn.openchange.org/filedetails.php?repname=openchange&path=%2Ftrunk%2Flibmapi%2FIProfAdmin.c

    Brad
    • Proposed As Answer byBrad Hards Monday, October 26, 2009 10:12 PM
    •