ADS Related Query

  • Thread starter Thread starter Arvind P Rangan
  • Start date Start date
A

Arvind P Rangan

Hi,

I like to know if there is any way we can use SQL Query syntax for
getting values out of ADS.

If there is any method pls let me know with example.

Thanks
Regards
ARvind Rangan
 
Hi Arvind

You can query ADS using the Active Directory Provider

example is below - note that I haven't tested this

Cheers

Jody

Dim cn As OleDb.OleDbConnection = New
OleDb.OleDbConnection("Provider=ADsDSOObject")
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand
Dim dr As OleDb.OleDbDataReader


Dim sADsDomain As String
sADsDomain = "mydomain"

cmd.CommandText = "SELECT distinguishedName FROM 'LDAP://" &
sADsDomain

cmd.Connection = cn
cn.Open()

Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter

da.SelectCommand = cmd
Dim ds As DataSet
da.Fill(ds)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top