1

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.

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

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.

Community
  • 1
  • 1
Nick
  • 1,178
  • 3
  • 24
  • 36
  • 1
    Can you show the results of this command? `dism /online /Get-FeatureInfo /FeatureName:RemoteServerAdministrationTools-Roles-AD-Powershell` – briantist Nov 16 '15 at 21:18
  • The formatting was awful when I copied it down here, so I edited the main post to include the results near the bottom. – Nick Nov 16 '15 at 21:27
  • 1
    Yeah that was probably for the best anyway. That output looks fine; exactly the same as mine (even the `Possible` restart required), so no clues there it seems. Edit: except my version is different (Win 8.1 here, looks like Win 7 for you?) – briantist Nov 16 '15 at 21:29
  • 1
    Sounds like a repair or reinstall is needed. This post http://blogs.msdn.com/b/rkramesh/archive/2012/01/17/how-to-add-active-directory-module-in-powershell-in-windows-7.aspx describes how to install the module. I would do the opposite to uninstall, then reinstall, unless you can find a repair option somewhere. (If you can find the MSI/MSU installers then you can run them from the command line with /? to find out the repair parameter name) – Χpẘ Nov 17 '15 at 00:47
  • Reinstalling it worked! Thank you both so much! – Nick Nov 17 '15 at 13:19

1 Answers1

0

Uninstalling, reinstalling, and re configuring Active Directory worked to fix it. For some reason it failed uninstalling twice, failed installing once, and I had to configure it in "Turn Windows Features on or off" four times because it would say that it took the changes, but after a restart, they would be gone.

On a side note, I also think that I know what caused the issue. Earlier in the day, I was writing a script to delete the files in a secure outlook folder. I was not running as an admin, so it shouldn't have done anything, but for some reason it started looping through system files. I got a million "Access Denied" messages, but I'm wondering if it managed to delete a file critical for the Active Directory module before it stopped.

Nick
  • 1,178
  • 3
  • 24
  • 36