question

T-0885 avatar image
0 Votes"
T-0885 asked RitaHu-MSFT commented

List of pc with os version

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-update-services
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello Tomasz,
It seems that there are no updates of the case. Please be kind to accept the right answer if the below answers are helpful. Or keep us in touch if there are any qiestions of the case.

Thanks for your time and wish you have a great day.

Best regards,
Rita

0 Votes 0 ·
RitaHu-MSFT avatar image
0 Votes"
RitaHu-MSFT answered RitaHu-MSFT edited

@T-0885
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.


16.png (86.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

T-0885 avatar image
0 Votes"
T-0885 answered RitaHu-MSFT converted comment to answer

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
}

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RitaHu-MSFT avatar image
0 Votes"
RitaHu-MSFT answered RitaHu-MSFT edited

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]: /answers/storage/attachments/200872-198.png


17.png (5.8 KiB)
17.png (5.8 KiB)
198.png (5.5 KiB)
18.png (54.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

T-0885 avatar image
0 Votes"
T-0885 answered RitaHu-MSFT commented

Thanks for your time and help !

Have a nice day!

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It is my pleasure. Please keep us in touch if you have any other questions. Please don't forget to accept the answer if the above answer is helpful. It will be helpful for others who have the same issue.

Have a great day :)

Best regards,
Rita

0 Votes 0 ·