1
我試圖通過我的C#應用程序從用戶帳戶中只刪除SIP地址。我可以使用以下命令通過Exchange管理外殼成功刪除它。通過交換機從用戶中刪除SIP地址
Set-Mailbox "identity" -EmailAddresses @{Remove="sip: [email protected]"}
在我的C#應用程序我有以下的,但我不知道如何讓「@ {刪除=」 SIP:[email protected]「}」在那裏。
string termUserEmail = txtboxTermFirstName + "." + txtboxTermLastName + "@domain.com";
PSCommand command1 = new PSCommand();
command1.AddCommand("Set-Mailbox");
command1.AddParameter("Identity", termUserEmail);
var sipAddress = new Hashtable();
sipAddress.Add("remove", termUserEmail);
command1.AddParameter("EmailAddresses", sipAddress);
所以,我不知道如何讓這個東西正確執行命令。我確實看過C# - Remove Exchange Email Address via Powershell Runspace這是我至今的事。