Thank you for the suggestion, Olaf, but I'm not looking for the domain
controller that I've logged on against. I need to find the nearest domain
controller for a specific domain - we have a multi-domain infrastructure that
spans multiple sites and we've got administrators in multiple sites working
on all of those domains, so my script needs to be able to connect to the
nearest DC for a specific domain in order to reduce replication impact on the
performance of the script.
Regards
Philip
"Olaf Engelke [MVP]" wrote:
> Hi Philip,
> Philip Colmer wrote:
> > I've got a multi-domain, multi-site infrastructure. I need to be able
> > to query the list of domain controllers for a given domain and figure
> > out which one is the nearest to me.
> >
> > If it helps, it would be safe to assume that the code is being run on
> > a PC in a site that has a domain controller for the domain in
> > question.
>
> if the Domain controller is in the same site as the PC, it is usually the
> one, which is used as logonserver.
> So with
> echo %logonserver%
> you should get the domain controller, which responded most quick to the
> logon attempt.
> Best greetings from Germany
> Olaf
>
|