Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



smallbyt

Member
  • Content count

    1
  • Donations

    $0.00 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About smallbyt

  1. LDAP in Win PE 2.0

    Hi All Hoping someone can help me out, I am trying to get LDAP working within WinPE and am so happy I found this forum because I was totally lost at the beginning. I have added the dll's and the registry key into my WinPE 2.0 boot image so thats all fine. I have a HTA that runs as part of our imaging process that promtps for various details about the machine, one thing I am trying to do is get a few of the drop down menus populated directly from AD. My HTA works fine when I run it on a normal Windows XP or Windows Server 2003 machine but when I run it from within WinPE I get the following error: "The specified domain either does not exist or could not be contacted" My code that executes the AD authentication and binding is below: Const ADS_SCOPE_SUBTREE = 2 Const ADS_SECURE_AUTHENTICATION = 1 Const ADS_SERVER_BIND = 200 Set objShell = CreateObject("Wscript.Shell") objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1406", 0, "REG_DWORD" objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1406", 0, "REG_DWORD" Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://ptcdcco1." & strDomainName & ".wa.gov.au/DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" , strDomainMaster , strDomainMasterPwd ,1 + 512) Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Properties("User ID") = strDomainMaster objConnection.Properties("Password") = strDomainMasterPwd objConnection.Properties("Encrypt Password") = TRUE objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Can anyone help me out with that error?
×