查找所有SMTP和smtp(来自AD / Exchange设置的主要和辅助电子邮件地址 [英] Find ALL SMTP and smtp (Primary and secondary emails addresses from AD/exchange settings
问题描述
大家好,我试图找到所有SMTP和smtp(主要和次要电子邮件地址来自AD /交换设置。我已经可以拉主SMTP但其余的(小写/非主要/次要的)电子邮件地址很难拉。我的事件尝试了
做了一些搜索或者它但似乎都在讨论主要的而不是全面的数据检索。
< pre class ="prettyprint"> using(PrincipalContext domainContext = new PrincipalContext(ContextType.Domain,domain))
{
using(UserPrincipal user = UserPrincipal.FindByIdentity(domainContext,username))
{
richTextBox2.AppendText(Convert.ToString(" Full Name(in AD)=" + user +" \ n"));
if((user.EmailAddress == null)| (domain!=" myDomain"))
{
richTextBox2.AppendText("无电子邮件地址(...与此域中的此ID相关联)\ n \ n");
}
else
{
richTextBox2.AppendText(user.EmailAddress +" \ n\ n");
}
}
}
https://stackoverflow.com/questions/21441487/find-all-e-mail-addresses-associated-with-a-user-in-active-directory-using-c -sha
在上面的链接中找到类似的东西。
Hi All, I am trying to find find ALL SMTP and smtp (Primary and secondary emails addresses from AD/exchange settings. I can already pull the primary SMTP but the rest of the (lowercase/non-primary/secondary) email addresses are hard to pull. I event tried doing some searches or it but all seem to be talking about the primary and not an all inclusive retrieval of data.
using (PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, domain)) { using (UserPrincipal user = UserPrincipal.FindByIdentity(domainContext, username)) { richTextBox2.AppendText(Convert.ToString("Full Name (in AD)= "+user + "\n")); if ((user.EmailAddress == null) | (domain != "myDomain")) { richTextBox2.AppendText("No email address (...associated with this ID in this domain)\n\n"); } else { richTextBox2.AppendText(user.EmailAddress + "\n\n"); } } }
https://stackoverflow.com/questions/21441487/find-all-e-mail-addresses-associated-with-a-user-in-active-directory-using-c-sha
Found something similar in the above link.
这篇关于查找所有SMTP和smtp(来自AD / Exchange设置的主要和辅助电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!