Is there a good tool to find $RECYCLE.BIN folders on network shares and their size?
In our environment we use roaming profiles and folder redirection for storing user profiles/data. Users are often lazy in cleaning up their recycle bin and so our network shares fill up.
I already tried it with a PowerShell script but it often fails or timeouts.
Thanks for any advice.
Best.
Thanks all for your answers. I found a shorter and in my opinion a more elegant way to to find "$RECYCLE.BIN" recursively on a network share or local directory using Windows PowerShell:
or you simply cd into the root directory where you want to start your search:
If you additionally want to display the size of the $RECYCLE.BIN folder you can use this, a bit more complicated, command:
or shorter:
(Keep in mind that if use use "Select-Object" you truncate the original return object only the specified members.)
Best!
A really dirty command-prompt one-liner might be:
(substitute
"D:\"
for the root path of your search).The summary of
ROBOCOPY
will give you a reasonable size indicator in its 'Skipped' column.Edit
Another really dirty one-liner, this time scanning all possible drive letters on a range of servers:
Of course, if gets to a point where such one-liners become unmaintanable so, in a batch file
scanbins.cmd
:...which you can call as
scanbins.cmd SERVER1 SERVER2 SERVER3