The specified module 'activedirectory' was not loaded

在Windows7下,在用powershell命令import-module activedirectory导入活动目录模块时碰到以下错误


import-module : The specified module 'activedirectory' was not loaded because
no valid module file was found in any module directory.
At line:1 char:1
+ import-module activedirectory
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (activedirectory:String) [I
   mport-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Comm
   ands.ImportModuleCommand


解决办法:

安装微软远程服务器管理工具,活动目录模块是这个管理工具的一部分。

https://www.microsoft.com/en-us/download/details.aspx?id=7887

安装完后,还需要在以下窗口勾选Active Directory Module for Windows PowerShell, 否则还是会失败。