Identify all live windows 2003 servers on domain

Windows Server 2003 will reach its end-of-life by July 2015, here's a simple way to identity live windows 2003 servers in your domain:

##needs import-module ActiveDirectory

$ErrorActionPreference = "Stop"


Get-ADComputer -Filter * -Property OperatingSystemVersion,Name | where {$_.OperatingSystemVersion -like "*5.2*"} | select-object Name | export-csv -delimiter "`t" -path c:\scripts\2003sq.txt


get-content c:\scripts\2003sq.txt |

select-string -pattern 'Name' -notmatch |

select-string -pattern '----' -notmatch |

select-string -pattern '#TYPE Selected.Microsoft.ActiveDirectory.Management.ADComputer' -notmatch |

% {$_ -replace '"', ""} |

out-file c:\scripts\2003s.txt


$2003 = get-content c:\scripts\2003s.txt


foreach ($comp in $2003)





test-connection -ComputerName $comp -count 1





"$comp appears inactive"





  • Nice script here !
    Very helpful if you only want a list of your servers.

    Thanks ! - PSkiller 5 years ago
This post is locked
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ