简体   繁体   中英

Using Active Directory Web Services in .Net application

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM