导入模块:未加载指定的模块“activedirectory",因为在任何模块目录中都找不到有效的模块文件 [英] Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any module directory

查看:45
本文介绍了导入模块:未加载指定的模块“activedirectory",因为在任何模块目录中都找不到有效的模块文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Server 2008 SP2(64 位)上执行导入模块 ActiveDirectory 时遇到问题.

I am having trouble doing an import-module ActiveDirectory on a Server 2008 SP2 (64 bit).

  • NET Framework 3.5 SP1 已安装
  • 我下载了 Windows6.0-KB968934-x86.msu(用于 ADWS)
  • 此文件未安装,提示更新不适用于我的系统"
  • 正在做一些研究(http://anti-american.rssing.com/chan-2091246/all_p15.html) 我在知识库文章 969166 中安装了修补程序并安装了上述更新.
  • 重新启动后,我注意到在服务中,Active Directory Web 服务正在运行
  • 我打开了一个管理 PS 提示并执行了导入模块 ActiveDirectory,但是...
  • NET Framework 3.5 SP1 is installed
  • I download the Windows6.0-KB968934-x86.msu (for ADWS)
  • This file did not install saying that "The update does not apply to my system"
  • Doing some research (http://anti-american.rssing.com/chan-2091246/all_p15.html) I installed hotfix in KB article 969166 and the above update installed.
  • After a reboot, I noticed that in services, Active Directory Web Services is running
  • I opened an administrative PS prompt and performed an Import-Module ActiveDirectory, but...

...我明白了:

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

如果有帮助,这里是 PSModule 路径、模块和版本中的一些信息:

If its any help, here's some info in PSModule Path, modules and the version:

PS C:Windowssystem32> $env:PSModulePath
C:UsersischmdDocumentsWindowsPowerShellModules;C:Windowssystem32WindowsPowerShellv1.0Modules

PS C:Windowssystem32> Get-Module -ListAvailable

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   BitsTransfer              {}
Manifest   PSDiagnostics             {}

PS C:Windowssystem32> $PSVersionTable.psversion

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1


PS C:Windowssystem32> $host.version

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1

非常感谢任何帮助.这样做的主要目的是通过 GET-AdUser 命令来自动化一些过程,但在这一点上,被难住了.我唯一的结论是,这在 Windows 2008 SP2 中是不可能的...

Any help is greatly appreciated. The main purpose of this is to GET-AdUser command to automate some process but at this point, were stumped. My only conclusion is that this is not possible with Windows 2008 SP2...

推荐答案

AD Powershell 模块应列在已安装的功能下.看图:

AD Powershell module should be listed under installed Features. See image:

.

这篇关于导入模块:未加载指定的模块“activedirectory",因为在任何模块目录中都找不到有效的模块文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆