[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Get Active Directory server from auth machine

Posted on 2009-07-01
3
Medium Priority
?
221 Views
Last Modified: 2013-12-24
Hey, I am developing an app and I need to know the server address for Active Directory, so I can do a connection. So I wanted to know if there is a way to get the IP address of the AD from my "client" machine.

Basically to know to wich server my machine authenticaded to the last time.

Thanks.
0
Comment
Question by:mendezcb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Expert Comment

by:Abhay Pujari
ID: 24760751
You can use ipconfig all which will show you your primary DNS server (If you have configured your DC as a DNS as well). OR If you know the name of the server, then try pinging it, will give you IP.
OR open my network places and browse for all computes on your network. You need to browse each machine. The machine which will show you SYSVOL and NETLOGON folders, is your DC. Try pinging it and will get the IP.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 24761054
Well, here's how XP does it:
How Domain Controllers Are Located in Windows XP
http://support.microsoft.com/kb/314861

DsGetDcName Function
http://msdn.microsoft.com/en-us/library/ms675983(VS.85).aspx

Depending on your needs, some easier possibilities might do it:
* check the environment variable %LogonServer%; this has the DC in it that authenticated the user (including two leading backslashes). This server might be down in the meantime.
* resolve the machine's primary domain suffix; this should resolve to a list of DCs of the domain to which the client is joined.
* if the application is run by a domain user, you can resolve the environment variable %UserDNSDomain% as well (no leading backslashes); this variable contains the domain that the user is logged on to (which, in the case of a trust, is not necessarily the same domain as the machine's domain!).
0
 

Author Closing Comment

by:mendezcb
ID: 31599068
Great explaining, and great solution! Is not only about having the answer is about know how to communicate it, you did both great. Thanks.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

650 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