Discussion:
use NETBIOS name to search AD in c#
(too old to reply)
t***@gmail.com
2006-08-30 19:18:11 UTC
Permalink
Hi. I am relatively new to using aactive directory and code to access
it. Basically, I am trying to find a Security Group within the AD. I
want to be able to search based on the NETBIOS name. Another catch is
that the group is located within a child domain.

I am using DirectorySeach in c# but whenever I use the netbios name,
nothing is found. I can use the fully qualified domain name of the
child domain to find the group, but that is all.

Does anyone have some sample code that could help me in the right
direction? Thanks.


Dave
Joe Kaplan
2006-08-30 20:31:31 UTC
Permalink
Probably the right thing to do here is to search the global catalog (GC)
first. If you don't know which domain to search in initially, then that's
always the way to go.

Generally, the NT name is <NetBIOS domain name>\<sAMAccountName>. So, you
can search in the GC by the sAMAccountName to find any principal in the
forest with that name:

(sAMAccountName=xxxx)

If you have the NetBIOS domain name, then it is not too difficult to figure
out what the domain DNS name and naming context distinguished name is. The
crossRef objects in the configuration container contain objects that allow
you to cross reference all that stuff, so you can just look it up. That
allows you to avoid the GC.

The other potential downside with the GC is that you could get duplicates,
since the sAMAccountName itself is only guaranteed unique in a specific
domain.

HTH,

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Post by t***@gmail.com
Hi. I am relatively new to using aactive directory and code to access
it. Basically, I am trying to find a Security Group within the AD. I
want to be able to search based on the NETBIOS name. Another catch is
that the group is located within a child domain.
I am using DirectorySeach in c# but whenever I use the netbios name,
nothing is found. I can use the fully qualified domain name of the
child domain to find the group, but that is all.
Does anyone have some sample code that could help me in the right
direction? Thanks.
Dave
chafey13
2006-09-17 06:14:52 UTC
Permalink
daughter some how gets in downloads my space from several accounts.i dodn't
no how
--
tamarachafey
Post by t***@gmail.com
Hi. I am relatively new to using aactive directory and code to access
it. Basically, I am trying to find a Security Group within the AD. I
want to be able to search based on the NETBIOS name. Another catch is
that the group is located within a child domain.
I am using DirectorySeach in c# but whenever I use the netbios name,
nothing is found. I can use the fully qualified domain name of the
child domain to find the group, but that is all.
Does anyone have some sample code that could help me in the right
direction? Thanks.
Dave
Loading...