Welcome to Powergui.org - an open source community for Windows Powershell

PowerGUI.org PowerGUI.org and blogs

Forums » Active Directory and PowerShell

Thread: Non AD LDAP Lookup

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 1 - Pages: 1 - Last Post: Dec 25, 2009 6:31 AM by: Dmitry Sotnikov
gareth.mcguinness_000

Posts: 54
Registered: 8/25/09
Non AD LDAP Lookup
Posted: Dec 18, 2009 6:00 AM
 
  Click to reply to this thread Reply

Hi All,

Not sure if this is appropriate for this forum but given that you have been so helpful in the past i thought I would post this anyway.


I have a mixed environment that has Novell and Sun One as well as AD so I want to be able to connect to those LDAP directories. I know this is possible using VB but as I am now trying to use PowerShell for everything. I want to know if there is a way to do this by using PowerShell.

This is the Vb Code I use at present:

Set NWIDirAuthenticator1 = CreateObject("NWIDirAuthLib.NWIDirAuthenticator.1")
Set NWIDirQuery1 = CreateObject("NWIDirQueryLib.NWIDirQuery.1.2")

strServer = "Server"
strTree  = "Tree"

'initialize the Authenticator control and  connect to the LDAP Directory NWIDirAuthenticator1.FullName = "LDAP://164.99.150.79/o=novell"
' connect anonymously to e-directory
NWIDirAuthenticator1.FullName = "LDAP://" & strServer & "/o=bskyb"
NWIDirAuthenticator1.Connect
 
'get the NWConnection object from Authenticator object
Set NWConnection = NWIDirAuthenticator1.Connection

'pass this connection object to other LDAP controls.
NWIDirQuery1.SetConnection NWConnection

NWIDirQuery1.Filter = "objectclass=person"
NWIDirQuery1.Fields = "cn,description,loginTime,loginDisabled,createTimeStamp,passwordExpirationTime,givenName,sn"
NWIDirQuery1.SearchScope = qrySearchSubtree
NWIDirQuery1.SearchMode = qrySearchSynchronous
NWIDirQuery1.MaximumResults = 10000

Cheers again


Gareth




Dmitry Sotnikov


Posts: 1,151
Registered: 12/1/06
Re: Non AD LDAP Lookup
Posted: Dec 25, 2009 6:31 AM   in response to: gareth.mcguinne...
 
  Click to reply to this thread Reply

Is NWIDirAuthLib.NWIDirAuthenticator.1 a COM object? In that case, try to experiment with:

$NWIDirAuthenticator1 = New-Object -ComObject NWIDirAuthLib.NWIDirAuthenticator.1

And so on...

Dmitry


Legend
MVP: 2501 + pts
Guru: 2001 - 2500 pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums