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...
On the Features page, expand Remote Server Administration Tools > Role Administration Tools > AD DS and AD LDS Tools, then select Active Directory module for Windows Powershell. Once selected, click Next. On the Confirmation page, click Install. Once the install completes successfully, click Close.
Solution: This error is because the PowerShell console or ISE is unable to get the module from given module path's in the environment variable “PSModulePath”. To fix the issue, You have to make sure your custom module's path is appended to the PSModulePath environment variable.
Find "Role Administration Tools" and expand it. Find "AD DS And AD LDS Tools" and expand it. Check the box next to "Active Directory Module For Windows PowerShell". Click OK and allow Windows to install the feature.
Installing PowerShell modules from the PowerShell Gallery is the easiest way to install modules. To install a package or module from the Gallery, we use the command: Install-Module or Install-Script cmdlet, depending on the package type.
AD Powershell module should be listed under installed Features. See image:
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With