I don't have any specific ideas on what you are doing wrong, but any connection string problems I got to this site:
http://www.connectionstrings.com
It has worked wonders for me in the past. It has every kind of connection string possible. Hope that helps.
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
As far as I know there's no (built-in) way to provide a connection string for Active Directory. DirectoryEntry does not accept a connection string in any of its constructors.
I know in legacy ASP you could use ADO to query the Active Directory. Maybe that's what you're after? I don't think this is possible in ADO.NET.
There's nothing that hinders you from inventing your own connection string style for Active Directory, which you then parse and use for instanciating your DirectoryEntry, but there is no built-in support for this, sorry.
If this post was useful to you, please mark it as answer. Thank you!
As far as I know there's no (built-in) way to provide a connection string for Active Directory. DirectoryEntry does not accept a connection string in any of its constructors.
I know in legacy ASP you could use ADO to query the Active Directory. Maybe that's what you're after? I don't think this is possible in ADO.NET.
There's nothing that hinders you from inventing your own connection string style for Active Directory, which you then parse and use for instanciating your DirectoryEntry, but there is no built-in support for this, sorry.
Is there a way to query the Active Directory via a VB script in an asp.net page, and then display the results in a table? The goal here is to create an always-current "Team Roster/Employee Contact List" that will automatically updated based on any changes
in Active Directory.
Next, scroll through
this article and simply copy the code you need. It is written in C# but should be fairly easy to translate into VB.NET if that's you choice. Let me know if you get stuck!
If this post was useful to you, please mark it as answer. Thank you!
Next, scroll through
this article and simply copy the code you need. It is written in C# but should be fairly easy to translate into VB.NET if that's you choice. Let me know if you get stuck!
Oh, really, there's no need to use a VB Script. I'm definitely open to implementing it all within the ASP.NET page -- or even C#, for that matter. I'm just learning these things, so I don't yet have a preference on which language I use to make this happen.
=)
Thanks for the links....I am going to check them out. I'm sure I'll be back with questions!
But I have to inform you that this is very badly documented. I've been searching the web for information, and I have only come up with a couple of links. And I haven't even managed to make the samples work in my own environment. So I wouldn't recommend this
path for you unless you are very keen on experimenting. I would suggest doing AD stuff using DirectoryServices in .NET.
If this post was useful to you, please mark it as answer. Thank you!
Yes ADSI as linked server is not well documented. It works well for basic queries: no updates. You need a service AD account and add this as any linked server in SQLSERVER: you can sp_addlinkedserver ... I do not remember the syntax OR use EM to add linked
server. After which query from this like from linked server. Something similar:
-- Add the linked server via SQL
sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'
EXEC sp_addlinkedsrvlogin 'ADSI', 'false'
ginab
0 Points
4 Posts
Connection Strings
Jun 11, 2008 07:08 PM|LINK
I'm attempting to use a Connection String to add my server (ideally, Active Directory) to the Data Source Catalog in Front Page.
I am having trouble entering a properly functioning connection string. I am trying the following --I begin as follows --
and -- and -- and and Any help would be much appeciated. As you can see, I have no idea what I'm doing wrong or if I'm even barking up the right tree! Thanks
jcrabtreesla
Member
422 Points
247 Posts
Re: Connection Strings
Jun 11, 2008 09:57 PM|LINK
I don't have any specific ideas on what you are doing wrong, but any connection string problems I got to this site: http://www.connectionstrings.com
It has worked wonders for me in the past. It has every kind of connection string possible. Hope that helps.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
johram
All-Star
28531 Points
3567 Posts
Re: Connection Strings
Jun 11, 2008 10:07 PM|LINK
As far as I know there's no (built-in) way to provide a connection string for Active Directory. DirectoryEntry does not accept a connection string in any of its constructors.
I know in legacy ASP you could use ADO to query the Active Directory. Maybe that's what you're after? I don't think this is possible in ADO.NET.
There's nothing that hinders you from inventing your own connection string style for Active Directory, which you then parse and use for instanciating your DirectoryEntry, but there is no built-in support for this, sorry.
ginab
0 Points
4 Posts
Re: Connection Strings
Jun 11, 2008 11:12 PM|LINK
Is there a way to query the Active Directory via a VB script in an asp.net page, and then display the results in a table? The goal here is to create an always-current "Team Roster/Employee Contact List" that will automatically updated based on any changes in Active Directory.
johram
All-Star
28531 Points
3567 Posts
Re: Connection Strings
Jun 11, 2008 11:18 PM|LINK
Why do you want to do it with a VB script? Why not implement it already in the ASP.NET page?
It doesn't take many lines of code :)
To get started, read Ryan Dunn's Common System.DirectoryServices Issues and Solutions which is required to understand how the security works between AD and your web app.
Next, scroll through this article and simply copy the code you need. It is written in C# but should be fairly easy to translate into VB.NET if that's you choice. Let me know if you get stuck!
ginab
0 Points
4 Posts
Re: Connection Strings
Jun 11, 2008 11:24 PM|LINK
Oh, really, there's no need to use a VB Script. I'm definitely open to implementing it all within the ASP.NET page -- or even C#, for that matter. I'm just learning these things, so I don't yet have a preference on which language I use to make this happen. =)
Thanks for the links....I am going to check them out. I'm sure I'll be back with questions!
raghu1
Contributor
2004 Points
558 Posts
Re: Connection Strings
Jun 12, 2008 07:46 PM|LINK
You can link ADSI to SQLSERVER as linked server and run SQL like queries.
ginab
0 Points
4 Posts
Re: Connection Strings
Jun 12, 2008 08:38 PM|LINK
That sounds great -- how would I go about this?
johram
All-Star
28531 Points
3567 Posts
Re: Connection Strings
Jun 12, 2008 09:06 PM|LINK
Here's one of the few articles on the subject:
http://blog.tech-cats.com/2007/09/querying-active-directory-through-sql.html
But I have to inform you that this is very badly documented. I've been searching the web for information, and I have only come up with a couple of links. And I haven't even managed to make the samples work in my own environment. So I wouldn't recommend this path for you unless you are very keen on experimenting. I would suggest doing AD stuff using DirectoryServices in .NET.
raghu1
Contributor
2004 Points
558 Posts
Re: Connection Strings
Jun 13, 2008 02:36 PM|LINK
Yes ADSI as linked server is not well documented. It works well for basic queries: no updates. You need a service AD account and add this as any linked server in SQLSERVER: you can sp_addlinkedserver ... I do not remember the syntax OR use EM to add linked server. After which query from this like from linked server. Something similar:
-- Add the linked server via SQL
sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'
EXEC sp_addlinkedsrvlogin 'ADSI', 'false'
--Query
SELECT * FROM OpenQuery(
ADSI,
'select
cn,
sn,
instanceType,
primaryGroupID,
whenCreated,
whenChanged,
sAMAccountName,
sAMAccountType,
objectCategory,
givenName,
distinguishedName,
displayName,
name,
telephoneNumber,
mail,
userPrincipalName,
userAccountControl
FROM ''LDAP://YourAdDomain/DC=...'' where objectClass = ''User''')
I could get the above working. Remember this brings up only first 1000 records. To test if a single account is valid, this works