1

作为序言,我制作的这个涉及创建 2007 MS Exchange 邮箱的脚本在一两个星期前工作过,突然给了我一个错误(如下):

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

给出的错误:

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.

我已经结束了,找不到任何帮助。该命令get-PsSnapins -registered没有给我任何东西。我做了一个干净的 Windows 7 安装,做了所有的 Windows 更新,我能想到的一切。我尝试在没有该管理单元的情况下运行它,但 powershell 无法将其识别为 cmdlet。没有想法和选择

我是网络、机器上的管理员,并以管理员身份运行 powershell。执行策略设置为无限制

4

1 回答 1

1

仅供参考,PowerShell 5.0+ 与 Microsoft Exchange 2013 不兼容:产品兼容性状态

您应该使用 PSRemoting 连接到 Exchange 服务器,并从那里运行Directly Loading Exchange 2010 or 2013 SnapIn Is Not Supported

$ExSession =  New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://exServer01.contoso.com/PowerShell/' -Authentication Kerberos
Import-PSSession ($ExSession) -AllowClobber

如果这在过去对您有用,请确保您正在启动 32 位Windows PowerShell (x86)版本的 PowerShell,因为 Exchange 管理单元不是 64 位。

于 2018-08-02T20:12:52.133 回答