我该如何解决:
/O=CHEESE/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=LHALA1
发送到电子邮件地址?我必须使用 Exchange 网络服务吗?
to an email address? Do i have to use Exchange Web Services?
我假设这是 legacyExchangeDN 属性.
I'm assuming this is the legacyExchangeDN Attribute.
试试这样的:
string dn = "/O=CHEESE/OU=FIRST ADMINISTRATIVE GROUP/" +
"CN=RECIPIENTS/CN=LHALA1";
string MailAddress=string.Empty;
string user = string.Empty;
using (DirectorySearcher ds = new DirectorySearcher())
{
ds.Filter = string.Format("(&(ObjectClass=User)(legacyExchangeDN={0}))",
dn);
SearchResultCollection src = ds.FindAll();
if (src.Count > 1)
{
//Oops too many!
}
else
{
user = src[0].Properties["samAccountName"][0].ToString();
MailAddress = src[0].Properties["Mail"][0].ToString();
}
}
这篇关于Microsoft Exchange:如何解析可分辨名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!