I've been using PowerShell, and specifically the Active Directory module daily for nearly 5 months now. Today, I went to import the module, and got the error:
PS H:\> import-module activedirectory
import-module : The assembly 'Microsoft.ActiveDirectory.Management' was not loaded because no assembly with that name was found. Verify the assembly name, and then try again.
At line:1 char:1
+ import-module activedirectory
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], DllNotFoundException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
I've been Googling for hours, and I still have no idea what is going on. Nothing has changed on my computer, I have not installed any new softwares, modules, or patches. ALL of the AD Windows Features are enabled, and I've rebooted multiple times. If I run Get-Module
, ActiveDirectory shows up:
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 ActiveDirectory
I've never seen anything like this before, so I've just been performing every step that I could find on Google.
Here is what I've done so far:
- Rebooted a million times
- Tried running the command in elevated Windows (still failed)
I am able to successfully run powershell -importsystemmodules
through CMD.
I do have the AD module at this location: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory
, as well as Documents (I'm not sure if it's supposed to be in both, that's just what I found).
PS C:\Windows> dism /online /Get-FeatureInfo /FeatureName:RemoteServerAdministrationTools-Roles-AD-Powershell
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7601.18489
Feature Information:
Feature Name : RemoteServerAdministrationTools-Roles-AD-Powershell
Display Name : Active Directory Module for Windows PowerShell
Description : Active Directory Module for Windows PowerShell provides a centralized experience for administering directory service objects.
Restart Required : Possible
State : Enabled
Custom Properties:
(No custom properties found)
Like I said, I did not make any changes on my computer. I hadn't even rebooted for a few days. I was using it this morning, and this afternoon it just stopped working.