1

I want to connect to a ActiveDirectory using c#.

I need to be able to connect to an DC which I can only resolve using an IP Address (which I have).

The next step is to find a computer in the DC address leases to resolve the IP address of a computername entered by a user.

Can someone give me a heads up?

I should be using

DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://DC-IpAddress");
directoryEntry.Path = "LDAP://(What should I enter here for "Address Leases"?);

then I need a returned value which gives me the IP-Address of target Computer.

Hope you folks can help me out a bit.

FYI: The DHCP Server is installed on the target DC. just in case ;)

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Nick Prozee
  • 2,823
  • 4
  • 22
  • 49
  • 1
    This sure sounds a lot like you're confusing LDAP with DNS. – Preston Guillot Oct 15 '13 at 20:31
  • 1
    I could be mistakes, yes. Lets say I need the DNS-record from the DC and then find my value.. – Nick Prozee Oct 15 '13 at 20:32
  • 1
    If you just want to resolve a name, `Dns.GetHostEntry()` will give you the IP Addresses associated with a DNS name. – Pete Oct 15 '13 at 20:51
  • The problem is that its not "just resolve à name", I need to resolve it through à remote DC. So I am unable to use my local dns server. The target computer is connected to à different DC than I am on. Although I do have à connection with the DC I need the pc-adress from – Nick Prozee Oct 15 '13 at 21:53

1 Answers1

1

in this link VB project which is contains in the forth section a method that Listing all computers in the Active Directory .. may it helpful for you

http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET