> For the complete documentation index, see [llms.txt](https://tenaka.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tenaka.gitbook.io/pentesting/enumeration/windows/computers/computer-ps.md).

# Computer PS

Get-ADComputer -Filter \* -Properties \* | where {$\_.operatingsystem -like "*2012*"}

Get-ADComputer -Filter 'operatingsystem -like "*2012*"'

Get-ADComputer -Filter \* -Properties DNSHostName | foreach {Test-Connection -count 1 -ComputerName $\_.dnshostname}

Get-ADComputer -Filter \* -Properties DNSHostName | foreach {Test-NetConnection -ComputerName $*.dnshostname -port 135} | where{$*.PingSucceeded -eq "true"}
