Reputation: 611
I am having trouble doing an import-module ActiveDirectory on a Server 2008 SP2 (64 bit).
...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...
Upvotes: 54
Views: 246551
Reputation: 11
This may be an old post, but if anyone is still facing this issue after trying all the above mentioned steps, ensure whether the default path of PowerShell module is specified under the PSModulePath
environment variable.
The default path should be %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
Upvotes: 1
Reputation: 21
If you don't have the Active Directory module installed on your machine, you need to download the correct Remote Server Administration Tools (RSAT) package for your OS.
If you are running windows 10 you can download Remote Server Administration Tools for Windows 10 update from here https://www.microsoft.com/en-us/download/details.aspx?id=45520
Once installed run 'import-module ActiveDirectory' using elevated PowerShell.
Upvotes: 2
Reputation: 27
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
Upvotes: 1
Reputation: 1251
Even better use implicit remoting to use a module from another Machine!
$s = New-PSSession Server-Name
Invoke-Command -Session $s -ScriptBlock {Import-Module ActiveDirectory}
Import-PSSession -Session $s -Module ActiveDirectory -Prefix REM
This will allow you to use the module off a remote PC for as long as the PSSession is connected.
More Information: https://technet.microsoft.com/en-us/library/ff720181.aspx
Upvotes: 1
Reputation: 22251
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
Upvotes: 16
Reputation: 70287
For non-servers this requires Remote Server Administration Tools for Windows __
Upvotes: 33
Reputation: 313
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.
Upvotes: 11
Reputation: 783
AD Powershell module should be listed under installed Features. See image:
.
Upvotes: 44