Search code examples
powershellsql-server-2016windows-server-2016

The specified module ActiveDirectory was not loaded


I have an SSIS job that executes a powershell module that's attempting to pull information from Active Directory. However, when I run the script I get this error:

The specified module ActiveDirectory was not loaded because no valid module file was found in any module directory

I found this similar question, however they are using Windows Server 2008, whereas I am using Windows Server 2016. I tried to follow the instructions in the question, but I wasn't able to locate neither "Remote Server Administration Tools" nor "Active Directory module for Windows Powershell."


Solution

  • Can you check whether Active Directory Web Services service is running under services?

    If not start it and run below command

    Get-module -list
    

    You can check whether Active Directory module is listed down.

    Run below command to Enable Active Directory module

    Add-WindowsFeature RSAT-AD-PowerShell