DsGetDcName() failures

Discussion in 'ASP General' started by Nick Burkitt, May 22, 2008.

  1. Nick Burkitt

    Nick Burkitt Guest

    I have an application that uses DsGetDcName() to determine the sites (and
    domains) of servers in the network.
    I have found that DsGetDcName() fails rather often, and the reason(s) is not
    obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE, although
    RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply retrying the call
    will result in success, but more often it does not.
    What can cause DsGetDcName() to fail (excluding the obvious situation where
    the server is down or otherwise not accessible)?
    Thanks,

    -Nick
    Nick Burkitt, May 22, 2008
    #1
    1. Advertising

  2. Nick Burkitt wrote:
    > I have an application that uses DsGetDcName() to determine the sites
    > (and domains) of servers in the network.
    > I have found that DsGetDcName() fails rather often, and the reason(s)
    > is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    > although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    > retrying the call will result in success, but more often it does not.
    > What can cause DsGetDcName() to fail (excluding the obvious situation
    > where the server is down or otherwise not accessible)?
    > Thanks,
    >

    What kind of application is this and what library provides the DsGetDcName
    method?

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 23, 2008
    #2
    1. Advertising

  3. Nick Burkitt

    Nick Burkitt Guest

    Hi Bob.

    Thanks. It's a VC++ app and I'm calling DsGetDcName() directly. I'm
    passing a NETBIOS name as the first parameter and requesting a DNS-style name
    by setting flag DS_RETURN_DNS_NAME. If the initial call fails with
    ERROR_NO_SUCH_DOMAIN, I set the DS_FORCE_REDISCOVERY flag and repeat the
    call. If the call fails for any other reason, I wait a bit (200 ms, I
    believe), and repeat the call. Ten strikes and you're out.
    Anything else you need?

    -Nick


    "Bob Barrows [MVP]" wrote:

    > Nick Burkitt wrote:
    > > I have an application that uses DsGetDcName() to determine the sites
    > > (and domains) of servers in the network.
    > > I have found that DsGetDcName() fails rather often, and the reason(s)
    > > is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    > > although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    > > retrying the call will result in success, but more often it does not.
    > > What can cause DsGetDcName() to fail (excluding the obvious situation
    > > where the server is down or otherwise not accessible)?
    > > Thanks,
    > >

    > What kind of application is this and what library provides the DsGetDcName
    > method?
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    >
    Nick Burkitt, May 23, 2008
    #3
  4. Hi Nick,

    As for the applicaiton, it is not an ASP web application, but a VC++ based
    desktop application ,correct?

    I haven't used Directory Sercies API much, however, since the error also
    contains E_ACCESSDENIED, is it related to your application's running
    identity since you may make remote query call to some remote machines?
    Also, have you checked to see whether those error mostly ocurs when you
    call the API against some certain remote machines?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------

    >From: =?Utf-8?B?TmljayBCdXJraXR0?= <>
    >References: <>

    <>
    >Subject: Re: DsGetDcName() failures
    >Date: Thu, 22 May 2008 18:47:01 -0700


    >Hi Bob.
    >
    >Thanks. It's a VC++ app and I'm calling DsGetDcName() directly. I'm
    >passing a NETBIOS name as the first parameter and requesting a DNS-style

    name
    >by setting flag DS_RETURN_DNS_NAME. If the initial call fails with
    >ERROR_NO_SUCH_DOMAIN, I set the DS_FORCE_REDISCOVERY flag and repeat the
    >call. If the call fails for any other reason, I wait a bit (200 ms, I
    >believe), and repeat the call. Ten strikes and you're out.
    >Anything else you need?
    >
    >-Nick
    >
    >
    >"Bob Barrows [MVP]" wrote:
    >
    >> Nick Burkitt wrote:
    >> > I have an application that uses DsGetDcName() to determine the sites
    >> > (and domains) of servers in the network.
    >> > I have found that DsGetDcName() fails rather often, and the reason(s)
    >> > is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    >> > although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    >> > retrying the call will result in success, but more often it does not.
    >> > What can cause DsGetDcName() to fail (excluding the obvious situation
    >> > where the server is down or otherwise not accessible)?
    >> > Thanks,
    >> >

    >> What kind of application is this and what library provides the

    DsGetDcName
    >> method?
    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so I
    >> don't check it very often. If you must reply off-line, then remove the
    >> "NO SPAM"
    >>
    >>
    >>

    >
    Steven Cheng [MSFT], May 23, 2008
    #4
  5. You'll be unlikely to get an answer here: we concentrate on ASP/scripting
    questions. Congratulations if you do :)
    I've never done any C++ myself so there is no possibility that I will be
    able to help.

    You might try a group devoted to C++ questions. Perhaps one of these:
    http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=9&SiteID=1

    Or fire up a newsreader and go to comp.lang.c++

    Nick Burkitt wrote:
    > Hi Bob.
    >
    > Thanks. It's a VC++ app and I'm calling DsGetDcName() directly. I'm
    > passing a NETBIOS name as the first parameter and requesting a
    > DNS-style name by setting flag DS_RETURN_DNS_NAME. If the initial
    > call fails with ERROR_NO_SUCH_DOMAIN, I set the DS_FORCE_REDISCOVERY
    > flag and repeat the call. If the call fails for any other reason, I
    > wait a bit (200 ms, I believe), and repeat the call. Ten strikes and
    > you're out.
    > Anything else you need?
    >
    > -Nick
    >
    >
    > "Bob Barrows [MVP]" wrote:
    >
    >> Nick Burkitt wrote:
    >>> I have an application that uses DsGetDcName() to determine the sites
    >>> (and domains) of servers in the network.
    >>> I have found that DsGetDcName() fails rather often, and the
    >>> reason(s)
    >>> is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    >>> although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    >>> retrying the call will result in success, but more often it does
    >>> not. What can cause DsGetDcName() to fail (excluding the obvious
    >>> situation where the server is down or otherwise not accessible)?
    >>> Thanks,
    >>>

    >> What kind of application is this and what library provides the
    >> DsGetDcName method?
    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so
    >> I don't check it very often. If you must reply off-line, then remove
    >> the "NO SPAM"


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 23, 2008
    #5
  6. Nick Burkitt

    Nick Burkitt Guest

    Hi Bob.

    Wow - I must have fat-fingered the group name when I first posted. This was
    supposed to go to ASDI General Questions. :-#
    Thanks for your time - I'll post again with hopefully better aim.

    -Nick


    "Bob Barrows [MVP]" wrote:

    > You'll be unlikely to get an answer here: we concentrate on ASP/scripting
    > questions. Congratulations if you do :)
    > I've never done any C++ myself so there is no possibility that I will be
    > able to help.
    >
    > You might try a group devoted to C++ questions. Perhaps one of these:
    > http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=9&SiteID=1
    >
    > Or fire up a newsreader and go to comp.lang.c++
    >
    > Nick Burkitt wrote:
    > > Hi Bob.
    > >
    > > Thanks. It's a VC++ app and I'm calling DsGetDcName() directly. I'm
    > > passing a NETBIOS name as the first parameter and requesting a
    > > DNS-style name by setting flag DS_RETURN_DNS_NAME. If the initial
    > > call fails with ERROR_NO_SUCH_DOMAIN, I set the DS_FORCE_REDISCOVERY
    > > flag and repeat the call. If the call fails for any other reason, I
    > > wait a bit (200 ms, I believe), and repeat the call. Ten strikes and
    > > you're out.
    > > Anything else you need?
    > >
    > > -Nick
    > >
    > >
    > > "Bob Barrows [MVP]" wrote:
    > >
    > >> Nick Burkitt wrote:
    > >>> I have an application that uses DsGetDcName() to determine the sites
    > >>> (and domains) of servers in the network.
    > >>> I have found that DsGetDcName() fails rather often, and the
    > >>> reason(s)
    > >>> is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    > >>> although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    > >>> retrying the call will result in success, but more often it does
    > >>> not. What can cause DsGetDcName() to fail (excluding the obvious
    > >>> situation where the server is down or otherwise not accessible)?
    > >>> Thanks,
    > >>>
    > >> What kind of application is this and what library provides the
    > >> DsGetDcName method?
    > >>
    > >> --
    > >> Microsoft MVP - ASP/ASP.NET
    > >> Please reply to the newsgroup. This email account is my spam trap so
    > >> I don't check it very often. If you must reply off-line, then remove
    > >> the "NO SPAM"

    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    >
    Nick Burkitt, May 23, 2008
    #6
  7. Hi Nick,

    I originally also guess that you may post the question in this group by
    mistake :)

    Anyway, if you have any ASP related web dev questions, welcome to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------

    >From: =?Utf-8?B?TmljayBCdXJraXR0?= <>
    >References: <>

    <>
    <>
    <>
    >Subject: Re: DsGetDcName() failures
    >Date: Fri, 23 May 2008 09:39:01 -0700


    >
    >Hi Bob.
    >
    >Wow - I must have fat-fingered the group name when I first posted. This

    was
    >supposed to go to ASDI General Questions. :-#
    >Thanks for your time - I'll post again with hopefully better aim.
    >
    >-Nick
    >
    >
    >"Bob Barrows [MVP]" wrote:
    >
    >> You'll be unlikely to get an answer here: we concentrate on

    ASP/scripting
    >> questions. Congratulations if you do :)
    >> I've never done any C++ myself so there is no possibility that I will be
    >> able to help.
    >>
    >> You might try a group devoted to C++ questions. Perhaps one of these:
    >> http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=9&SiteID=1
    >>
    >> Or fire up a newsreader and go to comp.lang.c++
    >>
    >> Nick Burkitt wrote:
    >> > Hi Bob.
    >> >
    >> > Thanks. It's a VC++ app and I'm calling DsGetDcName() directly. I'm
    >> > passing a NETBIOS name as the first parameter and requesting a
    >> > DNS-style name by setting flag DS_RETURN_DNS_NAME. If the initial
    >> > call fails with ERROR_NO_SUCH_DOMAIN, I set the DS_FORCE_REDISCOVERY
    >> > flag and repeat the call. If the call fails for any other reason, I
    >> > wait a bit (200 ms, I believe), and repeat the call. Ten strikes and
    >> > you're out.
    >> > Anything else you need?
    >> >
    >> > -Nick
    >> >
    >> >
    >> > "Bob Barrows [MVP]" wrote:
    >> >
    >> >> Nick Burkitt wrote:
    >> >>> I have an application that uses DsGetDcName() to determine the sites
    >> >>> (and domains) of servers in the network.
    >> >>> I have found that DsGetDcName() fails rather often, and the
    >> >>> reason(s)
    >> >>> is not obvious. The typical error code is RPC_S_SERVER_UNAVAILABLE,
    >> >>> although RPC_E_ACCESS_DENIED is popular, as well. Sometimes simply
    >> >>> retrying the call will result in success, but more often it does
    >> >>> not. What can cause DsGetDcName() to fail (excluding the obvious
    >> >>> situation where the server is down or otherwise not accessible)?
    >> >>> Thanks,
    >> >>>
    >> >> What kind of application is this and what library provides the
    >> >> DsGetDcName method?
    >> >>
    >> >> --
    >> >> Microsoft MVP - ASP/ASP.NET
    >> >> Please reply to the newsgroup. This email account is my spam trap so
    >> >> I don't check it very often. If you must reply off-line, then remove
    >> >> the "NO SPAM"

    >>
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so I
    >> don't check it very often. If you must reply off-line, then remove the
    >> "NO SPAM"
    >>
    >>
    >>

    >
    Steven Cheng [MSFT], May 26, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: So many failures early on

    Kevin Spencer, Aug 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    324
    Kevin Spencer
    Aug 27, 2003
  2. Guest
    Replies:
    0
    Views:
    407
    Guest
    Jun 19, 2004
  3. tommy
    Replies:
    0
    Views:
    350
    tommy
    Jul 19, 2004
  4. jlambrecht
    Replies:
    0
    Views:
    551
    jlambrecht
    Dec 22, 2004
  5. MikeB
    Replies:
    4
    Views:
    340
    Owen Jacobson
    Oct 26, 2004
Loading...

Share This Page