System info Check All Servers in a Domain


systeminfo /s %computername% | findstr /c:"Model:" /c:"Host Name" /c:"OS Name"


import-module activedirectory
get-adcomputer -filter {operatingsystem -like "windows server*"} | select-object name | export-csv .\computers.txt -notypeinformation -encoding UTF8
(Get-Content .\computers.txt) | % {$_ -replace '"', ""} | out-file -FilePath .\computers.txt -force -encoding ascii
$computers= get-content .\computers.txt | select -Skip 1
Foreach($computer in $computers){systeminfo /s $computer | findstr /c:"Model:" /c:"Host Name" /c:"OS Name" | out-file -FilePath .\VirPhys.txt -append }

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.