Get-ADComputer Examples with Screenshots

Updated

get adcomputer command

Looking for a list of Get-ADComputers examples and filters? Then look no further.

The Get-ADComputer cmdlet is used to search Active Directory for computer accounts. You can use it to list all computers in your domain, filter by name, OU, or operating system, and pull specific properties like IP address or last logon date. In this guide, I’ll cover the most common Get-ADComputer examples with ready-to-use commands.

Get-ADComputer Examples

Example 1. Get All AD Computers

get-adcomputer -filter *

This command will get a list of all computers in the domain.

get all computer accounts

Example 2. Get All Computers with all properties

get-adcomputer -filter * -properties *

This command will get all computers and all of the computer properties (attributes). By default, the get-adcomputer command only displays 8 properties. You must use the -properties * command to list them all.

get all computers and all properties

Example 3. Get All Computers from an OU

Get-ADComputer -Filter * -SearchBase "OU=ADPRO Computers,DC=ad,DC=activedirectorypro,DC=com" 

This command will get all computers from a specific OU by using the -SearchBase parameter and the distinguishedName of the OU.

get all computers from ou

Example 4. Get All Computers and Show Specific Properties

Get-ADComputer -Filter * | select name, Enabled

This command will get all computers and limit the output to display the name and enabled properties only.

get all computers status

Example 5. Get All Enabled Computers

Get-ADComputer -Filter "Enabled -eq 'True'"

This command uses the -filter option to limit the results to only enabled computers.

get all enabled computers

To limit the properties use the select option followed by the properties you want to display.

Get-ADComputer -Filter "Enabled -eq 'True'" | select Name, Enabled

Example 6. Get All Disabled Computers

Get-ADComputer -Filter "Enabled -eq 'false'" | select Name, Enabled

This command filters for enabled computers and limits the output to the name and enabled properties.

get all disabled computers
Get-ADComputer -Filter "Name -like 'SRV*'" | select Name, Enabled

This command searches for computers that start with srv in the name field.

filter computers by name

Example 8. Get All Computers and IP Addresses

Get-ADComputer -Filter * -properties * | select Name, Enabled,ipv4address

This command gets all computers and displays the IP address of each computer.

get all computers and ip address

Example 9. Get All Computers lastlogondate

Get-ADComputer -Filter * -properties * | select name,lastlogondate

This command gets all domain computers and displays the lastlogondate value.

get all computers lastlogondate

Example 10. Get All Computers Last Modified Date from an OU

Get-ADComputer -Filter * -SearchBase "OU=ADPRO Computers,DC=ad,DC=activedirectorypro,DC=com" -properties *| select name, whenchanged

This command will get all computers from a specific OU and display the computer’s last modified date (whenchanged attribute).

all computers from an ou and modified date

PowerShell Alternative: AD Pro Toolkit

The AD Pro Toolkit includes over 200 built-in Active Directory Reports for users, computers, groups, GPOs, and security. You can easily get all domain computers or computers from an OU.

You can customize the reports and build your own reports with the report builder.

Download AD Pro Toolkit and see how easy it is to create computer reports.

Report builder used to create a custom computer report

I hope you found this article useful. If you have questions or comments, please post them below. Refer to the Microsoft documentation to view the complete get-aduser syntax.