Is there a command that I can run on a windows Server 2008 r2 that will only show directories that contain a certain word.
For Example I want to find all directories that contain "logs"
That means it will return these all locations, since they contain the word "Logs"
C:\Logs
C:\stuff\ServerLogs
C:\example\Logsforapps
In
cmd
you can do a:dir /a:d /b /s C:\*logs*
Or if you've a recent-ish PowerShell version
Powershell can deliver what you're after with the following:
Use the File Classification Infrastructure (FCI) tool built in to server 2008+ to query the servers in question for the files with the specific word.
How to find directories with 'log' in them.
Example: log filetype:directory will return all directories with the word log in it. Remember to select the starting folder. Example: Documents search will return only what was found in the default documents folder. C:\Windows will return everything within the Windows folder. Selecting C:\ drive with Admin privileges should get you everything on the C: drive. If you have multiple drives select "Computer" then search keyword filetype:directory
Updated with simple script.
The above will search all your internal and mapped drives in your explorer.exe view. The location: can be set if you need to check only select drives. It would look like
You can repeat this for every target drive or folder path you need to search.
From my testing on 2008 R2 I found simply leaving the location without a target will search all physical and mapped drives.