There is no specific PowerShell cmdlet or script to fetch all computers accounts in a specific Active Directory (AD) domain. You will have to use the Get-ADComputer cmdlet, and use the right parameters and filters to get the desired list of AD computer accounts. For example, to get all computers in a domain you will have to use a filter; to get all inactive computers you will have to fetch the list based on the last logon time parameter; the operating system parameter to fetch computers running on a specific OS, and so on.
In short, every time you wish to get a list of computers that match a specific criteria, you will have to create a new PowerShell script or create a new one. On the other hand, ADManager Plus, a purely GUI-based AD, Office 365, and Exchange management and reporting solution, offers predefined computer reports to list all computers matching a specific criteria, like all computers, all workstations, recently created/modified/deleted computers, etc. at just the click of a button. This article compares the process of getting the list of all computers in an AD domain using PowerShell and ADManager Plus to show how ADManager Plus is easily the best option.
This script will list all the computers in the domain. If you wish to export the report in a specific format, the script has to be modified, by adding the required format and the location to store the exported file.
Screenshot
Right from the report, you can enable/disable/delete computers, modify their attributes and more, using the report's built-in management options.
Limitations of using PowerShell to get AD computers list
Find information on Active Directory computer objects from prebuilt reports.
Get 30-day free trial.For AD User Management
For AD User Reporting
For GPO Management
For Password Management
For AD Group Management
For File Access Management
For AD Computer Management
For Office 365 Management
For Exchange Management
For Microsoft Graph PowerShell
Entra ID user management
Entra ID reporting
Entra ID group management and reporting
Entra ID domain management
Entra ID contact management and reporting
Other Entra ID tasks
For Azure AD PowerShell
Entra ID user management
Entra ID reporting
Entra ID group management
Entra ID group reporting
Entra ID domain management
Entra ID contact management and reporting
Other Entra ID tasks