如何使用Exchange 2007 PowerShell托管代码与Exchange 2010配合使用 [英] How could I use Exchange 2007 PowerShell Managed code work with Exchange 2010
问题描述
细节是我使用程序来管理用户的帐户(启用/禁用邮件),基于PowerShell
cmdlet并且在Exchange 2007中取得了成功,但是当我将Exchange 2007升级到Exchange 2010时,它无法正常工作。
erroe
消息:此计算机上未安装Windows PowerShell管理单元" Microsoft.Exchange.Management.PowerShell.Admin'。
非常感谢。
您需要更新代码以通过远程运行空间调用cmdlet 。这里有一些很好的例子:
通过Exchange Server 2010中的远程PowerShell进行编程访问
http://blogs.technet.com/b/exchange/archive/2009 /11/02/3408653.aspx
从托管代码调用Exchange Management Shell Cmdlet
http://msdn.microsoft.com/ EN-US /库/ ff326159%28V = exchg.140%29
The detail is I use a program to manager user's account(enable/disable mail), is based on PowerShell cmdlets and worked success with Exchange 2007, but when i upgrade exchange 2007 to exchange 2010 , it can't work.
the erroe Message:The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Admin' is not installed on this machine.'
many thanks.
You'll want to update your code to call the cmdlets via a remote runspace. Some good examples here:
Programmatic Access via Remote PowerShell in Exchange Server 2010
http://blogs.technet.com/b/exchange/archive/2009/11/02/3408653.aspx
Calling Exchange Management Shell Cmdlets from Managed Code
http://msdn.microsoft.com/en-us/library/ff326159%28v=exchg.140%29
这篇关于如何使用Exchange 2007 PowerShell托管代码与Exchange 2010配合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!