Create a list of all XP PCs in the AD (Active Directory)

Many will use a Windows network with Active Directory . However, the question often arises as to how the admin can access certain information that the Active Directory console simply does not provide. In our case, we wanted to know how many PCs or notebooks we still have in the AD that are equipped with Windows XP .

Windows XP has been an enormous security risk for some time now and so all Windows XP PCs should be gradually replaced by current Windows operating systems, preferably Windows 10. Unfortunately, this is not always possible, especially if old software is used or machine controls are addressed.

Nevertheless, we wanted to get an overview of the current status of XP PCs in the network and generate a list from them. In order to generate this AD list , we used the PowerShell console, as you can see here in the picture below.

Get-ADComputer

To be able to access the AD information at all, you have to load the ActiveDirectory Module into the PowerShell console. This works with the following PowerShell command.

ActiveDirectory import modules

The PowerShell command to output all Windows XP computers is as follows:

Get-ADComputer -Filter {OperatingSystem -like ‚* XP * ‘} -Property * | ft Name, OperatingSystem,
OperatingSystemServicePack, OperatingSystemVersion, LastLogonDate

We have now specified ” * XP * ” as a placeholder for the operating system . You can of course also replace this space with ” * Server * “, ” * Windows 10 * ” or something else. As columns, we have included the operating system (operating system name), the installed service pack, the operating system version and the last logon date . You can of course expand the list with many other fields or replace errors. You can get a complete list of all AD errors that are available in this PowerShell command if you start from “ | ft “all let off. Then the list is output as a table with all field names.

With the PowerShell you can do many more interesting things. Here is a selection of the options.

– Ping, IPConfig and Tracert as PowerShell commands
– Read WindowsUpdate.log on Windows 10 or reformat using PowerShell – Install
Windows roles and features with PowerShell – Read
computer system information with PowerShell
– Edit local users and groups with PowerShell
– Windows system runtime determine
with PowerShell
– create Windows 10 system restore point with PowerShell –
shutdown and restart Windows with PowerShell commands – repair Windows component store with DISM and PowerShell commands
– switch off UAC (user account control ) with PowerShell or registry with Windows 10
– PowerShell command to deactivate the Firewall

administrator