Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Searching for certain files types on remote servers through Powershell is excruciatingly slow.

I am using this command

Get-ChildItem \\servername\e$\ -recurse -Filter *.txt

Is there a better way to search for files remotely?

share|improve this question

A much better approach would be to run the search locally on the machine that contains the files.

share|improve this answer
If both systems are Win7/Server2008R2 you can run winrm quickconfig on the remote system. Then run something like invoke-command -computername remote01 -scriptblock {get-childitem ...} – Chris S Aug 8 '11 at 12:54
Sure - which is running a search locally on the machine that contains the files. It doesn't need to be orchestrated from that machine; that's simply where the search needs to be run. – mfinni Aug 8 '11 at 15:19
Right, sorry if that came across strangely. Was just trying to give a concrete example of what you were proposing. That +1 you've got is from me; for giving what I would consider the "correct" answer. – Chris S Aug 8 '11 at 15:29

Yes there is an extremely fast solution for that which offers the results in a second. Unless you look for a GUI search. It's called Everything. Give it at least a try.

When you are convinced by the ultimate speed then probably you can convince the author to provide an API for that.

If you need something effective in Powershell, then you are lost.

Edit There is an equal tool TFind (command line) that does the trick without an initial index. But it can't be simply used from remote. But you may to convince somebody to extend the system for remote calls.

share|improve this answer
The link goes to a tool called Everything...maybe needs edit or did you mean "Anything"? – Bart Silverstrim Aug 8 '11 at 12:43
1. "No, 'Everything' only indexes local or removable NTFS volumes." 2. This works against an index; not the live file system. Definitely worth noting. – Chris S Aug 8 '11 at 12:45
It needs an initial index. Then from there it is a live file system as it recognizes index changes. You don't have to use it when you say it's faster to iterate recursively through a remote folder structure... – mailq Aug 8 '11 at 13:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.