2013-12-15 17 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;

相關問題