PsInfo, a command-line tool that is part of the Sysinternals suite, gets key information about Windows systems, such as the type of installation, available disk space, installed applications, kernel build number, uptime, registered owner, and the number of processors.

PsInfo is a relatively small tool with only a few available options. To display the options, run psinfo /?.

PsInfo command line options

PsInfo command line options

Get local information ^

By default, PsInfo gets information from a local computer and does not require administrative rights to do so. To gather information from remote systems, administrative rights are required, which will be covered later in the post. To get information from a local computer, simply run psinfo from a command line.

PsInfo basic output

PsInfo basic output

PsInfo on 64-bit ^

On a 64-bit version of Windows, the values for physical memory and IE version are not displayed correctly. In my example, I have a VM with 8 GB of RAM and IE version 11. Unfortunately, PsInfo was last updated in 2016, and it is unclear whether this will ever be fixed.

Get installed applications ^

You can limit the output to only selected rows of information by using the full or partial name of the field. For example, to show only information about processors, use psinfo process, which will show all three rows related to processors. Unfortunately, an attempt to query different rows (such as psinfo process, kernel) ends up with an empty result.

To get a list of installed applications, add the -s option. This information is taken from the uninstall keys in the registry.

Use the s option to get installed software

Use the s option to get installed software

Get available disk space ^

If you want to get the available disk space, you can query the disk volume information by adding the -d parameter to the command. Only volumes with assigned drive letters are shown. Also, if you are using SUBST associations (assigning a drive letter to a folder), PsInfo will show the same statistics as the real volume. In the example below, I have a Z: drive mapped to C:\mymount.

Disk volume information

Disk volume information

Other disk information that is shown might be a mapped network drive (shown as type Remote). However, as network drive maps are done within the user context, PsInfo can only show mapped drives for the user running the tool. When querying drive information from remote computers, PsInfo runs under the SYSTEM context, so only drives mapped under the SYSTEM account are reported.

The option -h was used to show installed hotfixes; however, it is deprecated and no longer works in newer operating systems.

Use PsInfo on remote systems ^

All PsTools utilities support remote operations using a syntax that is consistent across the entire suite. Not all the utilities perform the operation the same way; there might be different requirements. PsInfo has the following system requirements for remote systems:

  • Requires Admin$ share to be accessible
  • Requires Remote Registry service

PsInfo also supports querying multiple computer names in one command. To query information from a remote system:

psinfo \\ws2022 or psinfo \\192.168.1.10
Gathering information from a remote system

Gathering information from a remote system

You can also query several servers at the same time. This can be accomplished in multiple ways. The first option is to use a comma-separated command, like this:

psinfo \\ws2022,ws2016

Another option is to create a text file with one server name per line, and then run this command:

psinfo @myservers.txt
Query information from remote systems using a text file

Query information from remote systems using a text file

The last option is to run psinfo \\*, which queries all servers found in the domain or workgroup.

Another common feature across PsTools is the use of alternate credentials on the remote system. As you may imagine, this is handy when you run the query from an account that does not have administrative permissions on the remote systems. The syntax is as follows:

Psinfo \\ws2022 -u LAB\Administrator -p Passw0rd

If you have a space in the username, simply use the "LAB\User Name" syntax. If you omit the -p, the tool will prompt for the password. All the utilities use the WNetAddConnection2 API, so passwords are not sent in clear text over the network.

Create CSV output ^

The last feature to mention today is CSV output. This is mainly useful when querying multiple computers at the same time. To create CSV output from a remote system, use the following:

psinfo \\ws2022,ws2016 -c 

If you want to have a different delimiter, use the -t parameter followed by the desired character. To use the tab character, use \t.

Tab delimited list of information

Tab delimited list of information

To export the results to a CSV or TXT file directly, use the standard console redirection syntax:

Subscribe to 4sysops newsletter!

psinfo \\ws2022,ws2016 -c >> result.csv

Final words ^

In this post, you have learned how to use Sysinternals PsInfo to get information such as the available disk space and the installed applications on local and remote Windows systems. Unfortunately, the tool has not been updated for a while and does not report proper hardware information from 64-bit systems.

avataravatar
0 Comments

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account