Сегодня хочу показать, как одной простой командой в powershell можно найти устаревшие серверы в домене. Точнее не серверы, а серверы на которых установлены старые ОС.
Собственно команда:
Get-ADComputer -Filter {enabled -eq "true" -and OperatingSystem -Like '*Windows Server*' } -Properties * | ` select-object name,*operatingsystem*,description | ` Where-Object {$_.operatingsystem -notlike '*2016*' ` -and $_.operatingsystem -notlike '*2012*' ` -and $_.operatingsystem -notlike '*2019*'} | ` Export-Csv -Path .\oldsystems.csv -Delimiter ',' -Encoding UTF8 -NoTypeInformation
По сути, в команде мы просто отфильтровываем новые системы. На выходе получим CSV файл, где будут все включенные серверы с версией ос 2008R2 или более старые.
Share the article with your friends in social networks, maybe it will be useful to them.
If the article helped you, you can >>thank the author<<