
Finding Windows XP Computer Objects in Active Directory with PowerShell
List (old) Windows XP computer objects in Active Directory with PowerShell.
1 min read
With PowerShell and the ActiveDirectory module, it is very easy to read out all Windows XP computer objects.
This quickly gives you a list of the “legacy cruft” in your own AD domain.
Import-Module ActiveDirectory
Get-ADComputer -Filter {operatingSystem -eq "Windows XP *" -and enabled -eq $true}
Of course, the “-Filter” parameter can be adapted to any other operating system. If you remove the “-and enabled […]” filter, disabled computer objects are listed as well.
Source
Microsoft Documentation: Windows Server 2021 R2 Powershell - Get-ADComputer