Exchange Powershell-如何从脚本内部调用Exchange 2010模块? [英] Exchange Powershell - How to invoke Exchange 2010 module from inside script?

查看:175
本文介绍了Exchange Powershell-如何从脚本内部调用Exchange 2010模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个脚本,该脚本可以使用AD和Exchange进行许多操作,而刚进入GUI的那部分需要开始使用Exchange,但是看不到可以手动指定包含Exchange的地方模块.我熟悉的正常过程是导入模块活动目录,但是导入模块交换不起作用.

I'm writing a script that does a number of things with AD and Exchange and just got to the part of the GUI where I need to start working with Exchange but don't see where I can manually specify to include the Exchange module. The normal process I'm familiar with is import-module activedirectory but import-module exchange doesn't work.

我执行了Get-Module -ListAvailable |选择名称,并且看不到任何表示Exchange的内容.但是,Exchange命令行管理程序IS已加载到我正在使用的Exchange服务器上.

I performed a Get-Module -ListAvailable | Select Name, and don't see anything indicating Exchange. However, the Exchange Management Shell IS loaded on the Exchange server I'm working on.

有人知道如何在脚本中包含Exchange 2010模块,以便我可以在内部使用特定于Exchange的cmdlet吗? TIA ...

Does anyone know how to include the Exchange 2010 module in my script so I can use the exchange-specific cmdlets internally? TIA...

推荐答案

您可以执行以下操作:

add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010

并且大多数方法都可以使用(尽管MS支持人员会告诉您不支持执行此操作,因为它会绕过RBAC).

and most of it will work (although MS support will tell you that doing this is not supported because it bypasses RBAC).

我已经看到某些cmdlet(特别是启用/禁用UMmailbox)的问题仅适用于加载的管理单元.

I've seen issues with some cmdlets (specifically enable/disable UMmailbox) not working with just the snapin loaded.

在Exchange 2010中,他们基本上不支持在实际EMS Shell的隐式远程处理环境之外使用Powershell.

In Exchange 2010, they basically don't support using Powershell outside of the the implicit remoting environment of an actual EMS shell.

这篇关于Exchange Powershell-如何从脚本内部调用Exchange 2010模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆