none
ADSI in Win PE 3.0

    Question

  • Does anyone have any ideas as to how to get this working?  I have a global infrastucture so dont want to go down the webservices route except as a last resort.

    I know Johan Arwidmark created a plugin which I used in 2.0, is there anything like this for 3.0, or are the files available so this one could be reworked?

    Thanks
    Monday, October 19, 2009 4:57 PM

Answers

  • My plugin for WinPE 2.0 works fine in WinPE 3.0 as well.

    Make sure to get the below files from a x86 Windows 7 machine and add to the plugin directory

    adsldp.dll
    adsnt.dll
    mscoree.dll
    mscorier.dll
    mscories.dll

    And use DISM to install the plugin.

    Dism /image:c:\mount /add-driver /driver:c:\plugins\adsi\adsi.inf

    Monday, October 19, 2009 8:13 PM
  • Hi, I got this working by creating a reg file with all the entries contained in the old adsi.inf, and copying the equivelent 64bit files, including and language files in the en-us directory.

    I am just loading the regfile within PE at the moement, but I would like to get an inf file working, do you know if there is something simple to be changed in the old one?

    Thanks
    Thursday, October 22, 2009 9:04 AM

All replies

  • My plugin for WinPE 2.0 works fine in WinPE 3.0 as well.

    Make sure to get the below files from a x86 Windows 7 machine and add to the plugin directory

    adsldp.dll
    adsnt.dll
    mscoree.dll
    mscorier.dll
    mscories.dll

    And use DISM to install the plugin.

    Dism /image:c:\mount /add-driver /driver:c:\plugins\adsi\adsi.inf

    Monday, October 19, 2009 8:13 PM
  • Great, thanks, Ill try that.

    Will it work for amd64?

    Thanks
    Wednesday, October 21, 2009 11:59 AM
  • Sorry, nope...
    Wednesday, October 21, 2009 1:26 PM
  • What a shame!

    The files do exist in a amd64 installation of Windows 7, do you think it will be possible to get it working by any means?
    Wednesday, October 21, 2009 2:44 PM
  • Maybe, just haven't spend any time with it... Don't see the point really, using web services is much more secure and flexible...  If you don't want to write them yourself (not that hard), you can download a few good ones from Maik Koster... http://mdtcustomizations.codeplex.com

    I will also post a few web services I have written for customers, and got their approval to post them to the community... should be within a week or two..
    Wednesday, October 21, 2009 6:41 PM
  • Thats brilliant, many thnaks for your help.

    My firm doesnt want additional infrastructure if we can get away with it so I will try and get the adsi working first, then go down the web services route.

    It looks like all the guids are the same accross the versions so is it just a case of recreating the registry entries and copying the files?  I didnt have any luck doing this an inf file so I will try something else (I think inf's for 64 are different in some way?)

    Thanks
    Wednesday, October 21, 2009 6:47 PM
  • Hi, I got this working by creating a reg file with all the entries contained in the old adsi.inf, and copying the equivelent 64bit files, including and language files in the en-us directory.

    I am just loading the regfile within PE at the moement, but I would like to get an inf file working, do you know if there is something simple to be changed in the old one?

    Thanks
    Thursday, October 22, 2009 9:04 AM
  • Send me the reg-file and I can create an .inf file for the 64-bit as well... you can email me at johan[dot] arwidmark [at] truesec [dot] com
    Thursday, October 22, 2009 9:25 AM
  • G'day, Have you created the inf file? how did it go? I too would like to get ADSI working on my PE3.0 64bit boot image. All i want to do is to be able to check if the computer name already exists in AD. I had it working under PE2.0 64-bit using an HTA front end to prompt for the computer name. There should be a simple way to do this. Regards, Obee Dy-Liacco obee[dot]dy-liacco[at]iag[dot]com[dot]au
    Monday, November 30, 2009 3:58 AM
  • I have updated my ADSI plugin for Windows PE, and also added x64 support.

    ADSI Plugin for Windows PE 3.0 (x86 and x64)
    http://www.deployvista.com/Blog/tabid/70/EntryID/127/language/en-US/Default.aspx

    Saturday, March 20, 2010 3:59 PM
  • My apologies to Johan and others reading this thread. I  posted what I thought was an error with the plugin, but turned out to be my script that needed a 2nd method of authentication in PE.

    Ive chosen to remove/delete the post(s), since it turned out to be unrelated to the quality of the plugin.

    Let me use this opportunity to thank you for the plugin, its great!

    • Edited by SilentChe Thursday, April 29, 2010 4:22 PM I was wrong, the problem was unrelated
    Thursday, April 29, 2010 1:22 PM
  • Hello,

    I have nearly the same problem. I customize the mdt hta wizzard to input the computer name during the installation. I also import the ADSI Plugin from Johan Arwidmark into the x64 boot image. If I start the script I get the error "table does not exist." The script runs under Win2k8R2 x64 without error messages and shows the entries.

    ' ADS Authentication constants that can be used.
     Const ADS_SECURE_AUTHENTICATION = &H1
     Const ADS_USE_ENCRYPTION = &H2
     Const ADS_USE_SSL = &H2
     Const ADS_USE_SIGNING = &H40
     Const ADS_USE_SEALING = &H80
     Const ADS_USE_DELEGATION = &H100
     Const ADS_SERVER_BIND = &H200
    
     Dim objRootDSE, strDNSDomain, adoCommand, adoConnection
     Dim strBase, strFilter, strAttributes, strQuery, adoRecordset
     Dim strDN, strUser, strPassword, objNS, strServer
    
     ' Specify a server (Domain Controller).
     strServer = "999wdsl01.WIN7DEPLOY.local"
    
     ' Specify or prompt for credentials.
     strUser = "WIN7DEPLOY\Administrator"
     strPassword = "master.2"
     
     ' Use ADO to search Active Directory.
     ' Use alternate credentials.
     Set adoCommand = CreateObject("ADODB.Command")
     Set adoConnection = CreateObject("ADODB.Connection")
     adoConnection.Provider = "ADsDSOObject"
     adoConnection.Properties("User ID") = strUser
     adoConnection.Properties("Password") = strPassword
     adoConnection.Properties("Encrypt Password") = true
     adoConnection.Properties("ADSI Flag") = ADS_SERVER_BIND
     adoConnection.Open "Active Directory Provider"
     Set adoCommand.ActiveConnection = adoConnection
    
     ' Search entire domain. Use server binding.
     strBase = "<LDAP://999wdsl01.win7deploy.local/dc=WIN7DEPLOY,dc=local>"
    
     ' Search for all users.
     strFilter = "(&(objectCategory=person)(objectClass=user))"
    
     ' Comma delimited list of attribute values to retrieve.
     strAttributes = "distinguishedName"
    
     ' Construct the LDAP query.
     strQuery = strBase & ";" & strFilter & ";" _
     & strAttributes & ";subtree"
    
     ' Run the query.
     adoCommand.CommandText = strQuery
     adoCommand.Properties("Page Size") = 100
     adoCommand.Properties("Timeout") = 30
     adoCommand.Properties("Cache Results") = False
     Set adoRecordset = adoCommand.Execute
    
     ' Enumerate the resulting recordset.
     Do Until adoRecordset.EOF
     ' Retrieve values.
     strDN = adoRecordset.Fields("distinguishedName").Value
     Wscript.Echo strDN
     adoRecordset.MoveNext
     Loop
    
     ' Clean up.
     adoRecordset.Close
     adoConnection.Close 

    Please can you help? Thank you.

    Thursday, December 30, 2010 1:34 PM
  • Hello,

    I found the mistake. I have to copy the adsldp.dll to Windows\system32\ in the x64 Boot Image.

    Stupid mistake.

    Monday, January 03, 2011 9:45 AM
  • Hello,

     

    I can’t get the ADSI support working for my 64 bit version of Windows PE 3.0.

     

    I have used the files from a Server 2008 R2 and also from Windows 7 64 bit,

    but the error always remains the same.

     

    The error occurs in the following line;

     

    Set openDS = GetObject(“LDAP:”)

     

    Error: Invalid syntax (800401E14)

     

    I got the same error in my 32 bit version of Windows PE 3.0,

    but after adding the ADSI support it works great.

     

    The 64 bit version of Windows PE 3.0 is created by your script.

     

    Can anyone help me?

    Friday, February 04, 2011 8:58 AM
  • Do you get the same error if you run the included Connect_to_DC_Sample.vbs script?

    / Johan

    Friday, February 04, 2011 12:49 PM
  • Yes it's the same error.

    Just tried rebuilding the image again without adding my own drivers but the error remains the same.

    Monday, February 07, 2011 9:27 AM
  • Most likely a missing file...

    Did you run the included batchfile (without modifications) to build the boot image?

    Can you verify that all below files are present in the boot image, and that the registry info in ADSIx64.inf is present in the WinPE registry

       adsldp.dll
       adsmsext.dll
       adsnt.dll
       mscoree.dll
       mscorier.dll
       mscories.dll

    / Johan

    Monday, February 07, 2011 12:25 PM
  • I created the boot image with your cmd file and without modifying it the last time.

    All the files are present and all registry entries should be present as well.

    John.

    Monday, February 07, 2011 1:58 PM
  • Upload the boot image somewhere and post the link... I need to take a look to help you...

    / Johan

    Monday, February 07, 2011 3:03 PM
  • I found a solution for the problem.

    I changed to the latest WAIK and then everything works.

    The version I was using before were also 2.0 but the WAIK on Microsofts homepage has a newer release date.

    Thank you for the great tool.

    John.

    Tuesday, February 08, 2011 9:49 AM
  • There is no code difference in the new release, they only corrected the version number. But I'm glad the reinstall helped.

    / Johan

    Tuesday, February 08, 2011 1:10 PM
  • Hi Johan

    First of all, thanks for a very nice job with that ADSI cab.

     

    I can get your script to work and connect EXCEPT if I use adoconnection.

     

    The error I get is: The specified domain either does not exists or could not be contacted.

     

    Do you have any idea what the problem could be ?

    Thanks in advance.

    Steen

    Tuesday, May 10, 2011 7:54 AM
  • ADSI in WinPE is quite limited compared with running the code in normal Windows.  You are way better of using web services.

    I have written a few for Active Directory that works natively with WinPE and MDT. You can download them, including source code, from http://prettygoodfrontend.codeplex.com/

    / Johan


    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch
    Tuesday, May 10, 2011 9:11 AM
  • Have seen the error "The program can't start because api-ms-win-core-registry-|1-1-0.dll is missing from your computer" when using your ADSI installer? This is the error I'm getting on my WinPE systems, both x86 and x64.

    Levi Stevens Technical Consultant - End User Computing - West Region Dell | Services

    Monday, June 04, 2012 9:04 PM
  • Can't say I have... do you get the error when running the dism command with the plugin *.inf file?

    / Johan


    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch

    Tuesday, June 05, 2012 10:01 PM
  • Turns out I was using SP1 binaries on WinPE 3.0 boot image which is based on SP0. Downloaded the RTM from MSDN and it worked great. FYI, the error presented in PE when my script instantiated the LDAP object.

    Levi Stevens Technical Consultant - End User Computing - West Region Dell | Services

    Wednesday, June 06, 2012 2:28 AM