2013-12-15 37 views

回答

2

看看Exchange Impersonation

您可以让一个特定的用户帐户冒充另一个用户帐户并访问他们的详细信息,而不需要他们的用户名和密码。

string impName = @"impy"; 
string impPassword = @"password"; 
string impDomain = @"domain"; 
string impEmail = @"[email protected]"; 

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010); 
service.Credentials = new NetworkCredential(impName, impPassword, impDomain); 
service.AutodiscoverUrl(impEmail); 

service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, @"[email protected]"); 

更多的参考资料: http://msdn.microsoft.com/en-us/library/dd633680(v=exchg.80).aspx

+0

太棒了!谢谢。我会处理它并发布更新。东西正在进步一些慢节奏的原因。 – user1034489

0

你可以使用这样的..

VAR userpicUrl = “/_layouts/15/userphoto.aspx?accountname=” + user.UserName + “& size = M & url =”+ user.ProfilePictureURl;

相关问题