Search for the users folder "My Documents" on the network file server.

Hi folks,

here is a file server on which the is user folders according the departments. Departments folder are at the root of drive C: for example c: \ Marketing, c: \ finance.I need a script checks for the folder "My Documents" for each user and displays a table of the results by departments. I tried to use the command Test-path but without success.

Please, help me
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
Displayed Title "My Documents" is stored internally as 'Documents'
When these redirected folders where setup did you give the users exclusive permissions or did you also give domain administrators permissions on these folders. This depends upon your companies policy.  If you just gave employees exclusive access (the same permissions that they have on a non-redirected folder) then you have to give the domain administrators group permissions

first you need to get a groups members
$adgroups="Marketing","Sales","Customer Support', "Production"
foreach ($group in $adgroups){
$users = get-adgroupmember  -Identity  $group
and so forth
$colItems = (Get-ChildItem $path -recurse | Measure-Object -property length -sum)
"{0:N2}" -f ($colItems.sum / 1MB) + " MB"

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.