【问题标题】:Run Exchange command from Windows Powershell从 Windows Powershell 运行 Exchange 命令
【发布时间】:2018-10-12 06:23:34
【问题描述】:

我已使用以下方法从 Windows Powershell 连接到 EMS:

&"C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1 "

我无法运行Get-ExCommandsDisable-Mailbox -Identity Test 而不会出现错误。 “Get-ExCommands 一词未被识别为 cmdlet、函数、脚本的名称...”

是否可以在 Win Powershell 中运行 Exchange 命令?

【问题讨论】:

    标签: powershell exchange-server ems


    【解决方案1】:

    这对我来说很好用:

    . 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'
    Connect-ExchangeServer -auto
    

    如果您没有在您使用的服务器上安装 Exchange 管理工具,您可以通过以下方式连接 Exchange:

    $s = New-PSSession -ConnectionUri http://putyourservernamehere/Powershell  -ConfigurationName Microsoft.Exchange 
    import-pssession $s
    

    【讨论】:

      【解决方案2】:

      我怀疑您需要导入 Exchange PowerShell 模块。看看这个: Exchange Powershell - How to invoke Exchange 2010 module from inside script?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-05-05
        • 2015-08-10
        • 1970-01-01
        • 2018-03-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多