Win PE Issue - Getting name of Domain Controller

Discussion in 'Windows Desktop Systems' started by aek, Mar 24, 2005.

  1. aek

    aek OSNN One Post Wonder

    have a LDAP query that I use to query AD. I query AD for a specific useraccoutnname in my Win PE environment. I query Ad while in winPE even before the machine gets ghosted and finally log into any domain.

    I need to use the name of my DC in my LDAP query that queries AD because without that my query fails and gives Table Does not Exist message. Currently I have been hard coding the name of the Domain controller, and that works fine.

    But can you get the name of the nearest AD Domain Controller, while in WinPE environment and before logging to any domain.

    This is what I had tried, but did not work for me.

    In my VB.Net Code modified for my WinPE Environment:
    Set MyDomain = GetObject("LDAP://RootDSE")
    MyDC = MyDomain.Get("dnsHostName")

    The above query basically gives me the name of the DC.

    I then tried to use this MyDC variable in my LDAP search but this did not work in WinPE environment. I still got the table does not exist message. (works fine from my machine on the domain as I am already logged on the domain).

    Any thoughts or suggestions of getting the name of Domain Controller.