Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
866 views
in Technique[技术] by (71.8m points)

windows server 2008 - Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any module directory

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

  • 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...

...I get:

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

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

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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

AD Powershell module should be listed under installed Features..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...