Enabling Active Directory Module for PowerShell via command line

7,273

The feature name is RemoteServerAdministrationTools-Roles-AD-Powershell

For future reference, dism will list all available features with the /get-features switch:

dism /online /get-features

Or with PowerShell:

Get-WindowsOptionalFeature -Online
Share:
7,273

Related videos on Youtube

Joshua Parnell
Author by

Joshua Parnell

Updated on September 18, 2022

Comments

  • Joshua Parnell
    Joshua Parnell over 1 year

    As a final step in my Win7 MDT task sequence, I would like to move each computer from the staging OU to the regular OU (so GPO's can be pushed). My deployment techs have proven less than reliable on manually moving them, so I thought to automate the process using PowerShell. In the task sequence, I can install RSAT via command line, and the next step is to enable that specific feature using dism:

    dism /online /enable-feature /featurename:RemoteServerAdministrationTools-<featurename>
    

    Then I run the PS script, disable it via dism, and uninstall RSAT with the same method. However, I cannot seem to find the feature name for the PowerShell module, as seen in this screenshot:

    Active Directory Module for Windows PowerShell

    I have searched all through Google and Technet, to no avail. I literally only need the PS module. I have tried to just copy the module folder, but when trying to import the module in my script, it tells me the assembly 'microsoft.activedirectory.management' was not loaded because no assembly was found, which means the assembly dll is buried somewhere in the RSAT installation.

    If you have any other suggestions on how to import that module without installing RSAT, I would actually prefer that, but nothing I have found thus far works.

    Thanks in advance.

  • Joshua Parnell
    Joshua Parnell almost 9 years
    Thank you for not only posting the featurename I needed, but also how I can get them. I figured there was probably a way to do exactly that, but I don't know if I was just too Googled to search correctly, or what. Regardless, thanks for the help