You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已连接EMS但Windows PowerShell无法运行Exchange命令,是否可行?

Can I Run Exchange Cmdlets in Windows PowerShell?

Absolutely you can run Exchange cmdlets directly in Windows PowerShell—you just skipped a key step after loading the RemoteExchange.ps1 script! Here's what you need to do to fix those "term not recognized" errors:

The Missing Step: Establishing the Exchange Server Connection

The RemoteExchange.ps1 script only sets up the necessary environment and loads connection-related functions—it doesn’t actually connect your PowerShell session to the Exchange server. Without that connection, the Exchange-specific cmdlets like Get-ExCommands or Disable-Mailbox won’t be available in your session.

Step-by-Step Fix

  1. First, run your existing command to load the script (this part was correct):

    &"C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1"
    
  2. Immediately after, run this command to connect to your Exchange server:

    Connect-ExchangeServer -auto
    

    The -auto parameter will automatically detect and connect to the appropriate Exchange server in your environment. If you need to target a specific server, you can replace -auto with -ServerName "YourExchangeServerName".

  3. Once the connection completes successfully, you’ll be able to run any Exchange cmdlet without errors. Try testing again with:

    Get-ExCommands
    Disable-Mailbox -Identity Test
    

Quick Notes

  • Make sure your user account has the necessary Exchange administrative permissions (e.g., Recipient Management role) to execute cmdlets like Disable-Mailbox.
  • This workflow is specific to Exchange Server 2010 (since you’re using V14 in the path). For newer Exchange versions or Exchange Online, you’d use different connection methods (like Connect-ExchangeOnline), but your setup here aligns with 2010’s requirements.

内容的提问来源于stack exchange,提问作者Mike

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:14:59