Active Directory 服务 - 电子邮件





3.00/5 (2投票s)
本文档描述了如何使用 ASP.NET 网页远程创建或删除 Active Directory 电子邮件。
引言
本文档描述了如何使用 ASP.NET 网页远程创建或删除 Active Directory 电子邮件。
背景
核心思想是电子邮件的创建和删除不能远程完成。电子邮件只能在持有 Active Directory 服务的服务器上添加或删除。
使用代码
我们可以这样做:
- 在 Active Directory 服务服务器或持有 Active Directory 服务的远程计算机上,我们需要创建并安装 WINDOWS 服务。
- 这个 Windows 服务包含一个类,该类包含以下方法:
- CreateUserEmail ( string adsUser)
- String adsUser 必须采用以下格式:[名字] [空格] [姓氏] [空格] [公司名称(OU,或 Active Directory 中的组织单位)]
- SecureYourString( string input ) – 此方法将普通字符串转换为安全字符串。
- CreateUserEmail ( string adsUser)
- 这个 Windows 服务包含一个类,该类包含以下方法:
- 在托管在远程计算机上的 ASP.NET 网站上(远离 Active Directory 服务,在本地或生产 IIS 上运行),我们有一个类,您可以随意命名,该类包含一个方法:
- ADS_CreateMailBox ( string firstName, string lastName, string userName, string companyOU)
- 在这个方法内部,我们使用以下两个类:
- System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType()
- RemotingConfiguration.IsWellKnownClientType()
- 在这个方法内部,我们使用以下两个类:
- ADS_CreateMailBox ( string firstName, string lastName, string userName, string companyOU)
- 而实现这一切的关键在于:在 Active Directory 服务服务器上,以及我们之前在那里创建的 Windows 服务 上,应该添加或复制一个来自我们本地 ASP.NET 网站的引用 DLL,而不是 Windows 或 Web 服务引用。