未加载指定的模块 ActiveDirectory

The specified module ActiveDirectory was not loaded

我有一个 SSIS 作业执行一个试图从 Active Directory 中提取信息的 powershell 模块。但是,当我 运行 脚本时出现此错误:

The specified module ActiveDirectory was not loaded because no valid module file was found in any module directory

我发现了这个 similar 问题,但是他们使用的是 Windows Server 2008,而我使用的是 Windows Server 2016。我尝试按照问题中的说明进行操作,但是我找不到 "Remote Server Administration Tools" 和 "Active Directory module for Windows Powershell."

您能否检查 Active Directory Web Services 服务是否 运行ning 在服务下?

如果不启动它并且 运行 在命令

Get-module -list

您可以查看Active Directory 模块是否已列出。

运行 下面的命令启用 Active Directory 模块

Add-WindowsFeature RSAT-AD-PowerShell