6
votes

I'm trying to build a .Net application to interrogate Active Directory.

Edit: I need to use a Web Service to do this as I will be talking to AD from a Sharepoint Workflow using a third party workflow tool that requires the use of a web service.

From my research, Windows 2008 R2 has Active Directory Web Services (ADWS) built in.

I can't find any details or examples anywhere on the web which tell me whether I should be able to use ADWS in a .Net application to read/write AD information.

Should I simply be able to add a web reference or is ADWS just for Powershell use.

Cheers,

Iain

2
Folks, just to clarify. I don't care about other ways to do this. I know they exist. I SPECIFICALLY want to know about ADWS and if it offers me a way to use a web service for AD. - Iain Carlin

2 Answers

2
votes

Looks like they created ADWS for PowerShell's ActiveDirectory module and Active Directory Administrative Center only. Though it seems possible to consume it directly due to it's WCF nature. But no, there's not even a single article on MSDN or a blog post out there on the net about this topic.

1
votes

If you need to query against AD, you can use .NET built insupport for querying Active Directory using either LDAP or ADSI.

The System.DirectoryServices namespace in .NET has all the tools you need to succesfully query, and manage AD objects.

The work flow is as follows:

  1. Create a DirectorySearcher Object
  2. Bind against your Active Directory (ie supply credentials)
  3. Create a search query filter
  4. Set any query parameters
  5. Execute the query
  6. Iterate over the result set