简体   繁体   English

在.Net应用程序中使用Active Directory Web服务

[英]Using Active Directory Web Services in .Net application

I'm trying to build a .Net application to interrogate Active Directory. 我正在尝试构建一个.Net应用程序来询问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. 编辑:我需要使用Web服务来执行此操作,因为我将使用需要使用Web服务的第三方工作流工具从Sharepoint工作流与AD通信。

From my research, Windows 2008 R2 has Active Directory Web Services (ADWS) built in. 根据我的研究,Windows 2008 R2内置了Active Directory Web服务(ADWS)。

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. 我无法在网络上的任何地方找到任何细节或示例,告诉我是否应该能够在.Net应用程序中使用ADWS来读取/写入AD信息。

Should I simply be able to add a web reference or is ADWS just for Powershell use. 我应该只是能够添加Web引用,还是仅供Powershell使用的ADWS。

Cheers, 干杯,

Iain 伊恩

Looks like they created ADWS for PowerShell's ActiveDirectory module and Active Directory Administrative Center only. 看起来他们只为PowerShell的ActiveDirectory模块和Active Directory管理中心创建了ADWS。 Though it seems possible to consume it directly due to it's WCF nature. 虽然它似乎可以直接使用它,因为它的WCF性质。 But no, there's not even a single article on MSDN or a blog post out there on the net about this topic. 但是,没有,甚至没有一篇关于MSDN的文章或关于这个主题的博客文章。

If you need to query against AD, you can use .NET built insupport for querying Active Directory using either LDAP or ADSI. 如果需要查询AD,可以使用.NET内置的不支持来使用LDAP或ADSI查询Active Directory。

The System.DirectoryServices namespace in .NET has all the tools you need to succesfully query, and manage AD objects. .NET中的System.DirectoryServices命名空间具有成功查询和管理AD对象所需的所有工具。

The work flow is as follows: 工作流程如下:

  1. Create a DirectorySearcher Object 创建DirectorySearcher对象
  2. Bind against your Active Directory (ie supply credentials) 绑定您的Active Directory(即供应凭据)
  3. Create a search query filter 创建搜索查询过滤器
  4. Set any query parameters 设置任何查询参数
  5. Execute the query 执行查询
  6. Iterate over the result set 迭代结果集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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