

Get-ADComputer -Identity SRV-DB01 DistinguishedName : CN=SRV-DB01,OU=Servers,OU=London,OU=UK,DC=contoso,DC=com

To get information about a specific computer account in the domain, specify its name as an argument of the -Identity parameter: It is sufficient that the account under which the cmdlet is being run is a member of the Domain Users / Authenticated Users group. To get information from AD using the cmdlets from the AD for PowerShell module, you don’t need to have the domain admin privileges.

You can get help on Get-ADComputer cmdlet parameters as usual with Get-Help command: To use the Get-ADComputer cmdlet in the desktop OSs (Windows 10, 8.1 or Windows 7), you must download and install the RSAT for your version of the OS and enable the AD-Powershell module from the Control Panel or using the command:Įnable-WindowsOptionalFeature -Online -FeatureName RSATClient-Roles-AD-Powershell Get-ADComputer – Cmdlet Syntax In PowerShell 3.0 (introduced in Windows Server 2012) or later, this module is imported by default, if the following component is installed: Remote Server Administration Tools -> Role Administration Tools -> AD DS and AD LDS Tools -> Active Directory module for Windows PowerShell.

Suppose your task is to find all inactive computers in Active Directory that have not been registered in a domain for more than 120 days and disable these accounts.īefore using Get-ADComputer cmdlet, you have to import Active Directory Module for Windows PowerShell with the command: This is one of the most useful cmdlets for searching AD computers by various criteria (to get information about AD user accounts, another cmdlet is used – Get-ADUser). You can use the PowerShell cmdlet Get-ADComputer to get various information about computer account objects (servers and workstations) from Active Directory domain.
