Get-ADComputer – Display Computers In OU Or AD Group ... - 4sysops
Maybe your like
- Author
- Recent Posts
- Assign recommended Windows security settings with the free Harden Windows Security app - Wed, Jun 11 2025
- Activate Windows authentication with a PIN - Mon, Jun 2 2025
- Hyper-V Quick Create: Deploy custom VM images - Mon, May 19 2025
Say you want to find out which computers will be affected if you link a GPO to a certain OU. You could run the following dsquery command:
Read 4sysops without ads for free dsquery computer "OU=IT,DC=contoso,DC=com" -o rdnThe result would be a list of computer names. If you omit the -o switch with the rdn value, you receive a list of Distinguished Names.
If you need further properties in addition to the name, or if you want to add a filter to the query, the Get-ADcomputer cmdlet is helpful. Like its counterpart Get-ADUser (which allows you to read user objects), you have to pass either the object name or a filter as parameter. If you want to display all computers, you can use -Filter with a wildcard:
Get-ADComputer -Filter *As usual, you can add conditional statements to the filter to restrict the output. The following example would display all Windows 8.1 PCs provided you named the computers accordingly:
Get-ADComputer -Filter "Name -like 'Win81*'"To limit the query to a particular OU, you need the additional parameter -SearchBase:
Get-ADComputer -Filter * -SearchBase "OU=IT, DC=contoso, DC=com"The search in a particular group follows a similar pattern:
Get-ADComputer -Filter * -SearchBase "CN=Workstations, DC=contoso, DC=com"If you want to list not only the default computer object attributes, you have to add -Properties * to the command.
11 Comments Read 4sysops without ads for free
Tag » Active Directory Get Computer Information
-
Get-ADComputer (ActiveDirectory) - Microsoft Docs
-
Get-ADComputer: Find Computer Properties In Active Directory With ...
-
Get-ADComputer- How To Find & Export AD Computers PowerShell
-
Get-ADComputer-Find Computer Details In OU With Examples
-
Get-AdComputer: Find Computers In OUs With PowerShell
-
How To Export A Computer List From Active Directory - Netwrix
-
How To Find Inactive Computers In AD With Or Without PowerShell
-
Get List Of All Computers In AD Using PowerShell - MorganTechSpace
-
Export Computer Object Information From Active Directory
-
Active Directory Queries With PowerShell - ScriptRunner
-
Getting List Of Computers With OS And Model - Spiceworks Community
-
Computer Information In AD Not Correct - Spiceworks Community
-
Get-ADComputer : Obtenir Des Informations Sur Les Ordinateurs
-
What Is Active Directory? How Does It Work? | Quest