windows command line to scan remote computers for .pst

drichman
drichman used Ask the Experts™
on
Is there a simple command line, or tool,  that we can use to scan remote domain joined computers to see if they have any .pst files on them, and if so, report on their sizes?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Any command will take a while since you have to look through all domain USERS folders for PST files.

That said, open Command.exe and try FIND. That should work.

Author

Commented:
Could you assist with the syntax for the find command? We are looking for *.pst on the C: drive on remote computers.
If you want to do it on regular base, this app might come handy. You setup parameters, domain, admin and password in main program interface, then go to WEB SERVER tab, START it and do search using web interface.
https://www.softperfect.com/products/searchengine/
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

NVITEnd-user support

Commented:
Using CMD..

1. Make stns.txt containing computer names...
host1
host2

Open in new window


2. Download and extract psexec

3. Open cmd window as domain admin.

4. Run psexec, sending output to c:\pstfiles.txt

Notes:
a. find /v "too long" filters out the possible extraneous info when the DIR command is run
b. If your pst files reside in different folders than c:\users, adjust as needed.
psexec @stns.txt cmd /c dir /s "c:\users\*.pst" | find /v "too long" >> c:\pstfiles.txt

Open in new window


5. View results in c:\pstfiles.txt
Business Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018
Commented:
@drichman  - FIND is not particularly optimal for what you want. DIR works better. I have tried this locally and it finds my PST files.

The post above (just before I posted) outlines a nice way to use DIR.
NVITEnd-user support
Commented:
This version puts the computername at the beginning of each DIR scan:

psexec @stns.txt cmd /c "echo %%computername%% -------------- & dir /s "c:\users\*.pst" | find /v "too long"" >> c:\pstfiles.txt

Open in new window

John Hurst is correct about using the DIR command...

You can use:

dir *.pst /s  

to scan each hard drive, and check all subdirectories (/s) on them...

You can also use /p to pause as each command windows fills to prevent scrolling off the screen if watching...

Be sure to change to root directory first, or it will scan from the current directory down...
LeeTutorretired
Top Expert 2009

Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Answers http:#a41190024 ; http:#a41190054 ; and http:#a41190288  correctly address this issue. Suggest 3-way split
NVITEnd-user support

Commented:
Neither 41190288 nor 41190024 addresses remote scans across domain computers. A split, if any, should be more like:
80% 41190054
10% 41190288
10% 41190024

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial