Get-Adcomputer- Find Operating System - ShellGeek
Maybe your like
The command to find the operating system name, and version of the computer in the Active directory is Get-AdComputer. This command has an OperatingSystem property that gets the operating system name.

PowerShell Get-AdComputer cmdlet in the active directory gets one or more active directory computer accounts using search criteria. It has an operating system name, and version attribute.
In a large organization, as a system administrator, it’s very important to have information about users, computers, and other objects in the active directory. Often we need the information to get adcomputer operating system version which can be helpful to apply policy, and upgrade OS jobs.
In this article, we will discuss how to get-adcomputer operating system in an active directory, and export a list of adcomputer operating systems to csv file using PowerShell.
Let’s understand using Get-AdComputer to find operating system with examples below
Table of Contents hide 1 Get-AdComputer Operating System 2 Get all ADComputer Operating System in OU 3 Get AdComputer Operating System filter by Server 4 ConclusionGet-AdComputer Operating System
You can get adcomputer operating system name, and version in the active directory using the below command
Get-ADComputer -filter * -Properties * | Select Name, OperatingSystemIn the above PowerShell script, it gets Get-AdComputer Operating System and Name using filter parameter with wildcard characters (*) to search within the active directory.
The output of above command to find adcomputer OS as below
PS C:\Windows\system32> Get-ADComputer -filter * -Properties * | Select Name, OperatingSystem Name OperatingSystem ---- --------------- ENGG-PRO Windows Server 2019 Datacenter OPER-01 Windows 10 Pro HR-101 Windows 10 Pro PS C:\Windows\system32>Get all ADComputer Operating System in OU
You can get adcomputer operating system name and version details in specific OU using the below command
Get-ADComputer -filter * -SearchBase "OU=HR,DC=SHELLPRO,DC=LOCAL" -Properties OperatingSystem | Sort Name | Format-Table Name,Enabled,OperatingSystem -AutoSizeIn the above PowerShell script, Get-AdComputer get computer account in OU specified by SearchBase criteria and pass the output to the second command.
Second command sorts by computer name and displays adcomputer operating system, name below
PS C:\Windows\system32> Get-ADComputer -filter * -SearchBase "OU=HR,DC=SHELLPRO,DC=LOCAL" -Properties OperatingSystem | Sort Name | Format-Table Name,Enabled,OperatingSystem -AutoSize Name Enabled OperatingSystem ---- ------- --------------- HR-101 True Windows 10 Pro HR-102 True Windows 10 Pro PS C:\Windows\system32>Get AdComputer Operating System filter by Server
If you have a requirement to find Windows Server 2019 Datacenter operating system for adcomputer accounts in the active directory, use the below command
Get-ADComputer -Filter {OperatingSystem -like '*Windows Server 2019*'}In the above PowerShell script, it get adcomputer operating system filter by an operating system like Windows Server 2019
The output of the above command to get adcomputer operating system by server version as below

Cool Tip: How to remove adcomputer PowerShell!
Conclusion
I hope the above article helps you to get adcomputer operating system name and operating system version in the active directory using the Get-AdComputer cmdlet.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.
Tag » Active Directory Export Computer List Operating System
-
How To Export A Computer List From Active Directory - Netwrix
-
How To Export A Computer List From Active ... - Spiceworks Community
-
How To Export All Computer List With Operating System From AD And All ...
-
Get-ADComputer- How To Find & Export AD Computers PowerShell
-
Export Computer Object Information From Active Directory
-
How To Export A Computer List From Active Directory
-
Get-ADComputer: Find Computer Properties In Active Directory With ...
-
PowerShell: Retrieve List Of Domain-Computers By Operating System
-
Get List Of All Computers In AD Using PowerShell - MorganTechSpace
-
List Active Directory Computers Based On Their Operating System.
-
Active Directory (AD) Computer Reports - ManageEngine
-
Active Directory Users And Computers - Windows Server Brain
-
Get-ADComputer-Find Computer Details In OU With Examples
-
Export Simple List Of All Computers In Multiple OU's In AD - Server Fault