Jump to content

Easy way to search multiple computers for specific file or file type?

Recommended Posts

Try the following:

Open the All Agents group. Go to the Computers > Remote monitors tab. Click on Add to create a monitor. Select Monitor results of an exe. 

In its parameters put the usual

"%windir%\System32\WindowsPowerShell\v1.0\powershell.exe" -noprofile -command 

followed by something like

"(Get-ChildItem -Path c:\ -Filter lterrors.txt -Recurse -ErrorAction SilentlyContinue -Force| measure-object).count"

Follow through the wizard and set the comparison value to 0. The PS command above will return 0 or some other number if it finds a copy of lterrors.txt on the C disk. Obviously change the path and filename to suit. Click through the wizard and choose the execution frequency, etc. Give it a few hours to propagate. 

Make sure you give is an easily identifiable name, like "pacxa-Does File xxx.yyy exist on C"

You can now open the list of monitors, filter on that monitor name and then filter on sucess or failure.

If you need to check all disks, then you would need to make a slightly more complicated PS command, but it wouldn't be too difficult.

Edited by imurphy
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...