有时候通过Invoke-Command远程到Exchange上执行命令或脚本报错,可以通过另一种方式实现远程管理

#导入Exchange模块
$RemoteServerMail = "mail04.xx.com"
$SessionMail = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$RemoteServerMail/PowerShell/  -Credential $Cred_Mail -AllowRedirection 
# Import-PSSession $SessionMail -AllowClobber
Import-PSSession $SessionMail -AllowClobber

#直接运行Ex命令即可
Get-Mailbox

 

相关文章:

  • 2021-10-08
  • 2021-04-01
  • 2021-09-02
  • 2021-09-25
  • 2021-09-30
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2021-12-10
  • 2021-10-13
  • 2022-01-04
  • 2021-06-03
相关资源
相似解决方案