There may be a way to scrub through DNS looking for SRV records that would
indicate the presense of AD, but I'm not sure how to do that. DsGetDCName
can't bootstrap a DC without some sort of domain info to go by though.
If the environment you were in had more than 1 domain or there was more than
one forest (which is typical in large networks), how would you know whether
a DC you found was relevant to what you want to do?
I'd suggest asking this question again on the
microsoft.public.windows.server.active_directory group to see if anyone else
has any ideas on how you might be able to do this.
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 Benjamin KalyttaPost by Joe KaplanIf the current account isn't a domain account, you must supply a domain
name here.
Sorry to mither you again, but let me explain a scenario.
There is a large network with various Domain Controllers within. Just
imagine there is a new PC connected to the network, the user or PC don't
know anything about the network and just want to know if there is any
Domain Controller within this network to connect with or do something with
it. Also imagine that DNS/Nameserver is set up already pointing to one of
the DNS Servers within network (whichs knows about DCs -> since there are
DC specifies DNS Records)
So there must be a way to get any of the DC (Domain) without knowing a
name or something. So what I think what DsGetDcName do is to do a kind of
DNS Record Query to get DC specific records which returns a list of
various DCs. But unfortunately it seems not to work.
Zones = DNSQueryGetZones(DNSServer, "_msdcs*")
foreach(Zone.Get("Domains") as Domain) {
... // Print all Domains
}
But I don't know if such queries are possible.
Regards,
Benjamin Kalytta