Learn What IT Pros Need to Know About Windows 11 - August 26th at 1 PM ET! Learn What IT Pros Need to Know About Windows 11 - August 26th at 1 PM ET!
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

Read the Best Personal and Business Tech without Ads

Staying updated on what is happening in the technology sector is important to your career and your personal life but ads can make reading news, distracting. With Thurrott Premium, you can enjoy the best coverage in tech without the annoying ads.

  • 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:

BECOME A PETRI MEMBER:

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

Register
Comments (0)

Leave a Reply

IT consultant, Contributing Editor @PetriFeed, and trainer @Pluralsight. All about Microsoft, Office 365, Azure, and Windows Server.

Register for Advanced Microsoft 365 Day!

GET-IT: Advanced Microsoft 365 1-Day Virtual Conference - Live August 24th!

Join us on Tuesday, August 24th and hear from Microsoft MVPs and industry experts about how to take advantage of Microsoft 365 at a technical level and dive deep into the features and functionality that will make your environment more secure and compliant.

RSVP Now

Sponsored By