Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

 

When subscribed to the list you should use your standard email client to send your posts to ActiveDir@mail.activedir.org.

List Archives

Subject: RE: [ActiveDir] System.DirectoryServices namespace in .NET: site awareness
Prev Next
You are not authorized to post a reply.

AuthorMessages
bdesmondUser is Offline

Posts:977

06/01/2010 6:46 PM  
There's a DomainController.FindOne() method that's helpful too.

Thanks,
Brian Desmond
brian@briandesmond.com

c - 312.731.3132

From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of Brian Arkills
Sent: Tuesday, June 01, 2010 12:29 PM
To: activedir@mail.activedir.org
Subject: RE: [ActiveDir] System.DirectoryServices namespace in .NET: site awareness

Granted that this isn't the best approach for FIM/ILM, but if you did want to do something like this in .net, then you'd leverage System.DirectoryServices.ActiveDirectory.

Specifically, you'd use the System.DirectoryServices.ActiveDirectory.ActiveDirectorySite.Servers property to get a System.DirectoryServices.ActiveDirectory.ReadOnlyDirectoryServerCollection object with a list of all the DCs in that site. System.DirectoryServices.ActiveDirectory.ReadOnlyDirectoryServerCollection is an enumerable collection, so easy to work with.


From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of Thomas Vuylsteke
Sent: Sunday, May 30, 2010 12:18 PM
To: activedir@mail.activedir.org
Subject: [ActiveDir] System.DirectoryServices namespace in .NET: site awareness

I've been playing around a bit in .NET to get a rules extension for a FIM MA.

In the extension I do a LDAP search against Active Directory to find out whether a given AccountName is already in use. Now I was wondering if anyone knows whether the following lines of code are "AD sites&services" - aware. Meaning it will locate a DC to use in the same site as the code is being ran from.

Dim objDeSearchRoot As New DirectoryEntry()

è Should take the domain of the server where the code is being ran

è How will it locate a DC? Will it bluntly use the current logon server? What if that one is unavailable, will it use search another one?

Dim objDeSearchRoot As New DirectoryEntry("LDAP://contoso.com")

è Same question as above, how will it locate a DC? Will it use DNS to lookup an IP for "contoso.com" and hence use some round roubin and 0 site-awareness

Dim objDeSearchRoot As New DirectoryEntry("LDAP://DC01.contoso.com")

è Well can't see how this makes sense, DC down is no more lookups


The following MSDN site explains the different options for binding, but not really how the DC location process works.
http://msdn.microsoft.com/en-us/library/ms815618


P.S. either way I'm not hardcoding strings in the DLL, I'm using a XML besides it.

You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > RE: [ActiveDir] System.DirectoryServices namespace in .NET: site awareness



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:MrPTSai
New TodayNew Today:0
New YesterdayNew Yesterday:0
User CountOverall:5234

People OnlinePeople Online:
VisitorsVisitors:44
MembersMembers:0
TotalTotal:44

Online NowOnline Now:

Ads

Copyright 2009 ActiveDir.org
Terms Of Use