myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


           



LDAP Queries in WinPE

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> VB Script >> LDAP Queries in WinPE Page: [1]
Login
Message << Older Topic   Newer Topic >>
LDAP Queries in WinPE - 5/1/2008 6:50:54 PM   
rbennett806


Posts: 659
Score: 8
Joined: 6/14/2006
Status: offline
Well after a hard day chasing some code I think I've missed something, and I hope someone here can help me out. What I'm trying to do is to connect to Active Directory in order to verify some computer names. Now, the weird part is that I can get my VBScript code to work just fine on a machine running Windows XP bound to the domain, as well as on an XP machine not bound to the domain. What I CAN'T get it to do is to work when running from a Windows PE disc. I'm using Windows PE 2.0, which should have everything included in it to do LDAP queries, but I'm hitting a wall.

The code that works perfectly fine on a machine not bound to the Active Directory domain is:
strDomainController = "DomainControllerName.MyDomain.com"
Set objNS = GetObject("LDAP:")
Set objRootDSE = objNS.OpenDSObject("LDAP://" & strDomainController & "/RootDSE", providerAccount, providerPassword, ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION)
strDNSDomain = objRootDSE.Get("defaultNamingContext")

And "providerAccount" is in the form of MyDomain\UserName, and "providerPassword" is the accompanying password.

So when I run this script it's throwing up an error on the "GetObject" line. Does anyone have any thoughts on how to do an LDAP query from within Windows PE?

Thanks!

Post #: 1
RE: LDAP Queries in WinPE - 5/2/2008 2:55:54 PM   
rbennett806


Posts: 659
Score: 8
Joined: 6/14/2006
Status: offline
I figured it out. I had just snagged the wrong WinPE .WIM image file from my stash of image files, and while I thought ADSI was integrated into this .WIM, that wasn't the case. So once I switched to my .WIM image with ADSI (I cracked open the .WIM and looked for the files just to double-check), my code works just fine.

(in reply to rbennett806)
Post #: 2
Page:   [1]
All Forums >> [Scripting Technologies] >> VB Script >> LDAP Queries in WinPE Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.469