[英]How to programmatically add mailbox alias on an Exchange 2007 server from C# web app?
As the subject says, I have a C# web application (.NET 3.5) that's communicating with an Exchange 2007 server. 正如主题所说,我有一个与Exchange 2007服务器通信的C#Web应用程序(.NET 3.5)。 What I need help with is to programmatically (preferably from the web app itself) add a new mailbox alias to a certain mailbox and then before sending out the mail set the new alias as the reply-to address.
我需要的帮助是以编程方式(最好是从Web应用程序本身)将新的邮箱别名添加到某个邮箱,然后在发送邮件之前,将新别名设置为回复地址。
I'm fairly new to scripting, but from what I've read so far, most people seem to be suggesting the Exchange Powershell to accomplish this. 我对脚本还不是很陌生,但是到目前为止,大多数人似乎都建议使用Exchange Powershell完成此任务。 Any hints towards a third-part API that would solve this would be appreciated.
对于解决该问题的第三方API的任何提示,我们将不胜感激。 I've looked at the EWS API but from what I've seen so far it doesn't look like that's what I'm looking for.
我已经看过EWS API,但是到目前为止,看来还不是我要找的东西。
This is not possible with EWS API. 对于EWS API,这是不可能的。 What you need is New-Mailbox PowerShell command.
您需要的是New-Mailbox PowerShell命令。
If you have PowerShell v2 installed, you can call it remotely, read about PowerShell Remoting. 如果安装了PowerShell v2,则可以远程调用它,了解有关PowerShell Remoting的信息。
You can use "managed code" to do this. 您可以使用“托管代码”来执行此操作。 Essentially, you are programmatically communicating with Powershell.
本质上,您是通过编程方式与Powershell进行通信。
http://msdn.microsoft.com/en-us/library/bb332449%28EXCHG.80%29.aspx http://msdn.microsoft.com/zh-cn/library/bb332449%28EXCHG.80%29.aspx
This, and other sources which you can find via Google, should help you write c# code to perform Powershell tasks. 这些以及您可以通过Google找到的其他资源,应该可以帮助您编写c#代码来执行Powershell任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.