Windows XP

Find Out How Many Computers Are Running Windows XP

In this easy Ask the Admin, I’ll show you how to quickly see how many computers you have in your environment still running Windows XP by using PowerShell to query Active Directory for that information.

Despite Microsoft support for Windows XP ending in April 2014, there are still many organizations running Windows XP. There are many reasons why some organizations are sticking with Windows XP, including limited IT budgets and legacy application compatibility needs with Windows XP and earlier versions of Internet Explorer. We’ve posted some advice on how to get the most out of Windows XP after support ends, but any system administrator would be well advised to keep tabs on exactly how many Windows XP clients are still in operation when the decision is made to finally take the plunge and migrate to Windows 7 or Windows 8.

So you can get a handle on the number of computers you still have running the legacy operating system, I’ll show you how to use PowerShell to query Active Directory (AD) for computer accounts associated with computers running Windows XP.

Query Active Directory using PowerShell

Log on to Windows Server 2012 (or another computer with the PowerShell cmdlets for Active Directory installed) using an account that has read access to Active Directory. If you’re a PowerShell novice and need some additional information to help you get up to speed, check out our PowerShell resource page.

Sponsored Content

Passwords Haven’t Disappeared Yet

123456. Qwerty. Iloveyou. No, these are not exercises for people who are brand new to typing. Shockingly, they are among the most common passwords that end users choose in 2021. Research has found that the average business user must manually type out, or copy/paste, the credentials to 154 websites per month. We repeatedly got one question that surprised us: “Why would I ever trust a third party with control of my network?

  • Open a PowerShell prompt, using either the icon on the desktop taskbar (Windows Server), or by switching to the Start screen, typing powershell and selecting Windows PowerShell from the search results (Windows 8).
  • In the PowerShell prompt, type: get-adcomputer -filter {operatingsystem -like “*xp*”} -properties operatingsystem | select name, operatingsystem | sort name and press Enter.

Now you will see a list of all the computer accounts in AD for computers running Windows XP, sorted by name.

Query AD for XP computers using PowerShell
Query AD for XP computers using PowerShell.

Export Results to a Spreadsheet

It might be useful to export the results to a spreadsheet so that you can access the information offline. All you need to do is create a variable ($XP) and export the results using the export-csv cmdlet:

$XP = get-adcomputer -filter {operatingsystem -like "*xp*"} -properties operatingsystem | select name, operatingsystem | sort name
$XP | export-csv .\xp.csv

.\xp.csv will place the file into the current working directory. You can alternatively specify a full file path.

Help Migrate to Windows 7 or 8

There’s plenty of help available on Petri IT Knowledgebase if you decide to migrate your aging XP computers to Windows 7 or 8. For more information, see Migrating from Windows XP to Windows 8.1: Enterprise Computing for upgrading multiple computers in a business environment, and How to Upgrade from Windows XP to Windows 8.1 for a single computer or home PC.

We’ve also put together a guide to Windows XP end of support that presents a number of options on how to manage Windows XP after Microsoft support has ended.

Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (0)

Leave a Reply

IT consultant, Contributing Editor @PetriFeed, and trainer @Pluralsight. All about Microsoft, Office 365, Azure, and Windows Server.
13 Email Threat Types to Know About Right Now

As email threats evolve and multiply, keeping track of them all—and staying protected against the many different types—becomes a complex challenge. Today, that requires more than just the traditional email gateway solution that used to be good enough.

In this eBook you will learn:

  • What are the most common and challenging email attacks for organizations?
  • How to defend against sophisticated email threats, such as spoofing, social engineering, and fraud
  • How to protect employees at the inbox level with the right technologies and security-awareness training
  • How to use a multilayered protection strategy to reduce susceptibility to email attacks and better defend your business and employees

Sponsored by: