是否有web服务API可用于管理exchange-server 2010上的帐户(可能会更新到2013 )?
到目前为止,我发现的是:
ECP (Exchange控制面板):虽然提供了所有预期的功能,但它似乎没有提供but服务,而只是提供了一个浏览器前端。我希望能绕过浏览器抓取。
EWS (Exchange Web Services):虽然它是一个Web服务,但它似乎只提供了标准的客户端功能,而没有提供管理帐户本身的功能。
有什么建议吗?
一个托管的C#-API会更好...
发布于 2014-07-17 16:13:36
我没有找到did服务来做这件事,而是找到了ExchangePowerShell。为此,您需要安装Exchange管理工具(例如,此处解释的http://exchangeserverpro.com/exchange-2010-install-management-tools/)和System.Management.Automation.dll的引用(可通过NuGet获得)。
为了让你上手,请找到我在下面用来证明概念的代码。
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://{HostnameOfExchangeServer}/powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", (PSCredential) null);
Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
using (PowerShell powershell = PowerShell.Create()) {
powershell.AddCommand("Get-MailboxServer");
runspace.Open();
powershell.Runspace = runspace;
return powershell.Invoke();
}由于PSCredential设置为null,因此使用普通的windows身份验证。
https://stackoverflow.com/questions/24765523
复制相似问题