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

nesher13
nesher13 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial