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:
- Create a DirectorySearcher Object
- Bind against your Active Directory (ie supply credentials)
- Create a search query filter
- Set any query parameters
- Execute the query
- Iterate over the result set
精彩评论