In this PowerShell azure tutorial, we will discuss how to fix the error, The specified module ‘ActiveDirectory’ was not loaded that comes while trying to import the ActiveDirectory module using Azure PowerShell cmdlet.
Table of Contents
- The specified module ‘ActiveDirectory’ was not loaded
- Import-Module: The specified module ‘ActiveDirectory’ was not loaded because no valid module file was found in any module directory
- The specified module ‘ActiveDirectory’ was not loaded [Solved]
- Import-Module: The specified module ‘ActiveDirectory’ was not loaded because no valid module file was found in any module directory [Solved]
- install-module ActiveDirectory
- import-module activedirectory not found server 2012 r2
- Wrapping Up
The specified module ‘ActiveDirectory’ was not loaded
Recently, while working with Azure PowerShell, I was trying to import the Active Directory module, I got the error “The specified module ‘ActiveDirectory’ was not loaded”. I was executing the below PowerShell cmdlet.
Import-Module: The specified module ‘ActiveDirectory’ was not loaded because no valid module file was found in any module directory
PS C:\WINDOWS\system32> Import-Module ActiveDirectory
You can able to see, once I ran the above PowerShell cmdlet, I got the above error The specified module ‘ActiveDirectory’ was not loaded

The complete error message was as below
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) [Import-M
odule], FileNotFoundException - FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.Im
portModuleCommand
- CategoryInfo : ResourceUnavailable: (ActiveDirectory:String) [Import-M
The specified module ‘ActiveDirectory’ was not loaded [Solved]
You can follow the below steps to fix the error The specified module ‘ActiveDirectory’ was not loaded.
Import-Module: The specified module ‘ActiveDirectory’ was not loaded because no valid module file was found in any module directory [Solved]
Solution -1:
Step-1: Run the Windows PowerShell or PowerShell ISE as “Run as administrator” mode.

Step-2: Check if the Active Directory Web Services is running on your machine. If it is stopped, you need to start it. You need to search for services.msc to find the Active Directory Web Services status.
Step-3: Now, run the below command to check out if the Active Directory module is present on your machine.
PS C:\WINDOWS\system32> Get-module -list
Step-4: Then, You can use the below PowerShell cmdlet to enable Active Directory module.
PS C:\WINDOWS\system32> Add-WindowsFeature RSAT-AD-PowerShell
Solution -2:
You can also try out the below steps to install the Azure Active Directory module which will fix this issue
- Navigate to the Control Panel and open it -> click on the Programs and Features -> Turn On/Off Windows Features
- Then you need to find out “Remote Server Administration Tools” and expand it.
- Now, Expand the “Role Administration Tools” node.
- Then, Expand AD DS and AD LDS Tools option.
- Make sure to tick the checkbox for Active Directory Module for Windows Powershell option
- Finally, click on the OK button to confirm the installation.
Now, you can run the Import command to import the Azure Active Directory module.
install-module ActiveDirectory
You can refer to the Solution-1 to install the ActiveDirectory module using PowerShell cmdlet.
import-module activedirectory not found server 2012 r2
If you are using Windows server 2012 R2 and you are trying to install the ActiveDirectory module but you are not able to then you can follow the below information to install the active directory module.
Step-1: Run the Windows PowerShell or PowerShell ISE as “Run as administrator” mode.

Step-2: Then, run the below PowerShell cmdlet.
Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell
You may also like to follow the below article
- The Specified Module ‘AzureRM’ Was Not Loaded
- How To Create Azure IoT Hub Using PowerShell
- The term ‘get-azuresubscription’ is not recognized
- CS1061 C# ‘HttpRequest’ does not contain a definition for ‘Content’ and no accessible extension method ‘Content’ accepting a first argument of type ‘HttpRequest’ could be found
- The ‘Set-AzContext’ command was found in the module ‘Az.Accounts’ but the module could not be loaded.
Wrapping Up
Well, in this article, we have discussed how to fix the error The specified module ‘ActiveDirectory’ was not loaded.
The above solution will also fix the below issues
- The specified module ActiveDirectory was not loaded
- Import-Module: The specified module ‘ActiveDirectory’ was not loaded because no valid module file was found in any module directory
- The specified module ‘ActiveDirectory’ was not loaded
- import-module activedirectory was not loaded windows 10
- import-module activedirectory not found windows 7
Hope it will help you to fix your issue as well !!!