激活交换 PowerShell 命令

activate exchange PowerShell commands

我必须使用如下命令:

Get-TransportServer
Get-OrganizationConfig
Get-MessageTrackingLog

但似乎我必须在我的 Exchange 服务器上做一些事情才能使用它们? 我收到一条 ObjectNotFound 错误消息。

感谢您的帮助。

这是代码和错误:

PS C:\Windows\System32> Get-OrganizationConfig | Select ReadTrackingEnabled

Get-OrganizationConfig : The term 'Get-OrganizationConfig' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-OrganizationConfig | Select ReadTrackingEnabled
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-OrganizationConfig:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

您肯定运行 这些命令在 Exchange 管理 Shell 之外。这是一个 PowerShell 控制台,使用特定的控制台文件并加载额外的 cmdlet,即您需要的那些。

看到这个:https://msdn.microsoft.com/en-us/library/cc505910.aspx

有关在经典 PowerShell 控制台中加载 cmdlet 的相关问题:Exchange Powershell - How to invoke Exchange 2010 module from inside script?