Didn't the notes in the MSDN help you? Look at this:
"If this flag is used in conjunction with a non-NULL value in the input
parameter SiteName, then ERROR_INVALID_FLAGS is thrown.
Also, the kind of search employed with DS_TRY_NEXT_CLOSEST_SITE is
site-specific, so this flag is ignored if it is used in conjunction with
DS_PDC_REQUIRED. Finally, DS_TRY_NEXTCLOSEST_SITE is ignored when used in
conjunction with DS_RETURN_FLAT_NAME because that uses NetBios to resolve
the name, but the domain of the domain controller found won't necessarily
match the domain to which the client is joined.
Note This flag is Group Policy enabled. If you enable the "Next Closest
Site" policy setting, Next Closest Site DC Location will be turned on for
the machine across all available but un-configured network adapters. If
you
disable the policy setting, Next Closest Site DC Location will not be used
by default for the machine across all available but un-configured network
adapters. However, if a DC Locator call is made using the
DS_TRY_NEXTCLOSEST_SITE flag explicitly, DsGetDcName honors the Next
Closest
Site behavior. If you do not configure this policy setting, Next Closest
Site DC Location will be not be used by default for the machine across all
available but un-configured network adapters. If the
DS_TRY_NEXTCLOSEST_SITE
flag is used explicitly, the Next Closest Site behavior will be used."
If you do not use the flag and if the "Next Closest Site DC Location"
behaviour is not set by GPOs, then the system falls back on the default
method of locating a domain controller - that means, a DC in you own site
is
searched, if there is no one found, a DC from another site is used (but
this
is not neccesary the "closesed" site)...
Philipp
<francois.beretti@[EMAIL PROTECTED]
> schrieb im Newsbeitrag
news:cc62ef72-557d-4439-a01f-bdf70d5c7c84@[EMAIL PROTECTED]
I saw in the online MSDN page of the DsGetDcName function :
http://msdn.microsoft.com/en-us/library/ms675983(VS.85).aspx
the DS_TRY_NEXTCLOSEST_SITE flag, which seems to be used to retrieve
the closest DC, by searching the local site, then the closest site (if
no DC is found in the local site), and so on.
This is strange since I used to think that was the standard behavior
of DsGetDcName. Anyway, I guess I have to use this flag. But if I use
it, I get ERROR_INVALID_FLAGS error.
I have found no code example on the web, so I am asking on the forum.
Does anyone know how to use this flag ?
Thank you
François Beretti


|