List of pc with os version

16 Reputation points
2022-05-10T12:59:18.967+00:00

Hello,

Can I in wsus prepare/export list of computer with particular windows version? For ex. I want to know which computers in ad have OS version below 21H2.

Tomasz.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,103 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Rita Hu -MSFT 9,626 Reputation points
    2022-05-11T02:32:35.577+00:00

    @TŁ
    Thanks for your posting on Q&A.

    We could run the below PowerShell script in DC and print the OperatingSystemVersion to identify the OS version. Here is a screenshot in my lab for your reference:
    200754-16.png

    Get-ADComputer -SearchBase 'OU=US,DC=msnoob,DC=com' -Filter * -Properties * | FT Name, OperatingSystem, OperatingSystemServicePack, OperatingSystemVersion -Wrap -Auto  
    

    We have to import the Active Directory Module for Windows PowerShell with the following command before running the above script to query the OS Version:

    Import-Module activedirectory  
    

    Best regards,
    Rita


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. 16 Reputation points
    2022-05-11T06:26:07.033+00:00

    Thanks for your post ! Could you also advise how export results to file? I add out-file C:\temp\kompy.txt -Append at end but it print nothing

    $data = Get-ADComputer -SearchBase 'OU=test,DC=test,DC=local' -Filter * -Properties * | FT Name, OperatingSystem, OperatingSystemServicePack, OperatingSystemVersion -Wrap -Auto
    if($data){
    out-file C:\temp\kompy.txt -Append
    }

    1 person found this answer helpful.
    0 comments No comments

  3. Rita Hu -MSFT 9,626 Reputation points
    2022-05-11T06:47:00.213+00:00

    Please try the following PowerShell script:

    Get-ADComputer -Filter * -Properties * | FT Name, OperatingSystem, OperatingSystemServicePack, OperatingSystemVersion -Wrap -Auto | Out-File -FilePath C:Temp\file.txt

    Note that remember to create a new folder named Temp included a txt file named with file.txt in the following path before you run the above command:
    C:\Windows\System32

    Reference screenshots:

    200789-17.png

    200777-198.png

    200797-18.png

    Hope the above will be helpful. Don't forget to accept the answer if the above is helpful :)

    Have a great day.

    Regards,
    Rita


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 2: /api/attachments/200872-198.png?platform=QnA

    1 person found this answer helpful.
    0 comments No comments

  4. 16 Reputation points
    2022-05-11T10:22:00.083+00:00

    Thanks for your time and help !

    Have a nice day!

    1 person found this answer helpful.