Solved

How to find the domain name for an MS Exchange server and for a LDAP server using C/C++?

Posted on 2008-06-18
2
3,609 Views
Last Modified: 2013-12-19
I'm new to Windows programming.  I'd like to use a C/C++ program to find the domain names of the local LDAP active directory server and the local MS Exchange server without knowing the addresses or names of the servers.  What are some ways to retrieve that information?  Thanks.
0
Comment
Question by:vsee
2 Comments
 
LVL 70

Accepted Solution

by:
Chris Dent earned 125 total points
Comment Utility

There are a couple of issues that need to be addressed.

You can't connect to something you know absolutely nothing about. So you would have to be able to determine what you were connecting to prior to into a database.

If you're running the program from a member of a domain it will happily let you get on with this because knowledge of the domain and it's services has been defined by that membership.

If you have nothing to do with the domain you would have to know or find a server with an LDAP service listening.

Once you've got that far you can query the RootDSE node for some basic information about the LDAP directory (LDAP://Server/RootDSE) then work down into the Configuration and dig out Exchange information.

That brings us onto the next issue. The information above isn't available to unauthenticated users, you must be able to log onto the domain. If you can do that you must know enough about the domain to skip the first stage anyway.

Chris
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now