Install Get-ADComputer

I see a lot of reference to the command ‘get-adcomputer’ but I don’t seem to be able to install it. One source that I looked at suggested that I use ‘install-windowsfeature’. When I try to get help on that I get:

Get-Help : Get-Help could not find install-windowsfeature in a help file in this session. To download updated help
topics type: “Update-Help”. To get help online, search for the help topic in the TechNet library at
http://go.microsoft.com/fwlink/?LinkID=107116.
At line:55 char:7

  •   Get-Help @PSBoundParameters | more
    
  •   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ResourceUnavailable: (:slight_smile: [Get-Help], HelpNotFoundException
    • FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

And I did to ‘Update-help’. It was also suggested that I ‘Import-Module ActiveDirectory’. When I do that 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:1

  • Import-Module ActiveDirectory
  •   + CategoryInfo          : ResourceUnavailable: (ActiveDirectory:String) [Import-Module], FileNotFoundException
      + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

Finally just getting help on ‘get-adcomputer’ gives me:

get-help : Get-Help could not find get-adcomputer in a help file in this session. To download updated help topics
type: “Update-Help”. To get help online, search for the help topic in the TechNet library at
http://go.microsoft.com/fwlink/?LinkID=107116.
At line:1 char:1

  • get-help get-adcomputer
  •   + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
      + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand
    
    

I am running PS v3 on a Windows Server 2008 SP2 x64. Ideas how I can get access to this command?

The ActiveDirectory module, which contains Get-ADComputer and the other AD-related commands, is installed on Windows Server 2008R2 and later domain controllers. It is also available as part of the Windows 7 and Windows 8 Remote Server Administration Toolkits (RSATs). It is not a Windows feature. It cannot be installed on Windows XP or Windows Vista, and to have it on a client computer you must install the RSAT. It is not intended to be run on server computers that are not domain controllers.

Update help is only capable of downloading help for locally installed modules. If you don’t have the module, you can’t have the help for it.

The module is capable of talking to any domain controller that runs Microsoft’s Active Directory Management Gateway service. This service is pre-installed on all DCs 2008R2 and later, and can be downloaded and installed on 2003 and 2008 DCs.

If you have at least one computer in your environment with the module installed (as a 2008R2 or 2012 DC would have), and that computer has PowerShell Remoting enabled, then you can implicitly remote the module (using Import-Module on v3 or Import-PSSession on v2), allowing you to use it locally even though it is not installed locally. Again, Remoting has to be enabled and configured for this to work, and there are a few bugs in the implementation that may prevent some commands from working correctly through that model.

(a short summary: The ActiveDirectory module is a feature of the OPERATING SYSTEM, not a feature of a PowerShell version; 2008 does not include this feature and never will - it is a feature of newer versions of the OS).