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

186,320

Solution 1

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

AD Powershell module should be listed under installed Features. .

Solution 2

For non-servers this requires Remote Server Administration Tools for Windows __

Solution 3

The ActiveDirectory module for powershell can be installed by adding the RSAT-AD-Powershell feature.

In an elevated powershell window:

Add-WindowsFeature RSAT-AD-PowerShell

or

Enable-WindowsOptionalFeature -FeatureName ActiveDirectory-Powershell -Online -All

Solution 4

You can install the Active Directory snap-in with Powershell on Windows Server 2012 using the following command:

Install-windowsfeature -name AD-Domain-Services –IncludeManagementTools

This helped me when I had problems with the Features screen due to AppFabric and Windows Update errors.

Solution 5

On Windows 10 - This happened for me after the latest update in 2020.

What solved this issue for me was running the following in PowerShell

C:\>Install-Module -Name MicrosoftPowerBIMgmt
Share:
186,320

Related videos on Youtube

KidBomba
Author by

KidBomba

Updated on July 09, 2022

Comments

  • KidBomba
    KidBomba almost 2 years

    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:\Windows\system32> $env:PSModulePath
    C:\Users\ischmd\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    
    PS C:\Windows\system32> Get-Module -ListAvailable
    
    ModuleType Name                      ExportedCommands
    ---------- ----                      ----------------
    Manifest   BitsTransfer              {}
    Manifest   PSDiagnostics             {}
    
    PS C:\Windows\system32> $PSVersionTable.psversion
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    2      0      -1     -1
    
    
    PS C:\Windows\system32> $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...

    • uSlackr
      uSlackr over 10 years
      Install is a two step process - once you run that KB install, you have to open Add/Remove programs/Add Windows features and select the AD components to install.
    • KidBomba
      KidBomba over 10 years
      In Server 2008, Add Windows features takes you to the Server Manager. Under features I Go to "Remote Server Admin Tools" and "Active Directory Domain Services Tools" inc controller tools is already installed. I dont see anything with regards to ACtive Directory and powershell. Note: Windows Powershell appears installed in the features menu.
    • Amit Tyagi
      Amit Tyagi over 9 years
      @KidBomba did you got this resolved ?
  • KidBomba
    KidBomba over 10 years
    This option is not present in Windows Server 2008..... I think the screenshot above is 2008 R2...
  • Adaptabi
    Adaptabi over 9 years
    This exists in Windows Server 2012
  • pblack
    pblack over 8 years
    For Windows 7 these options will be present after installing the Remote Server Administration Tools for Windows 7 Link
  • kshitij Sabale
    kshitij Sabale over 7 years
    This will install quite a bit more than just the management tools. The specific feature required is RSAT-AD-Powershell.
  • uSlackr
    uSlackr almost 7 years
    Quite a bit more - it adds the Domain controller bits. Seems overkill!
  • Sergei Krivonos
    Sergei Krivonos over 6 years
    ActiveDirectory-Powershell not found
  • hamish
    hamish over 4 years
    Install-windowsfeature : The term 'Install-windowsfeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  • Andrew
    Andrew about 4 years
    I have been using this module occasionally for months, but it suddenly quit working. I didn't make the connection that the company pushed out an update from Windows 10 1803 to Windows 10 2016. I had to reinstall the module for the new OS version.
  • NateJ
    NateJ about 3 years
    In Windows 10 Pro 1909, and probably in most non-server builds, a lot of the stuff on this page didn't work, and I instead had to do this, which I found on a number of other articles with a caveat: Add-WindowsCapability –online –Name “Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0” should be changed to just Add-WindowsCapability –online –Name “Rsat.ActiveDirectory.DS-LDS.Tools” I did this after downloading and installing the RSAT msu from the bottom link above.
  • Golden Lion
    Golden Lion about 2 years
    what does Enable-WindowsOptionalFeature -FeatureName ActiveDirectory-Powershell -Online -All do?