Finding users home directory size to include Linux files.

Hello all,

I am in the middle of a project to create a script to find the file size for all users we have in AD, however some of our users use both Windows and Linux. I am using the script found at this site

http://community.spiceworks.com/scripts/show/1942-get-the-size-of-your-user-s-ad-home-directory

The issue is that when I run it against AD if the file name has a period(.) in front of it I get access denied. Is there a way to get around it? The script  is not adding the file size to the output so a user that actually has 29 MB of data only shoes 8.7 MB of data at the completion of the script.

any help would be appreciated.

August 21st, 2015 1:04pm

A windows file name cannot begin with a period.

I recommend asking the author of the script to fix it for you.  We do not fix scripts found on the web.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 1:37pm

Your question is far too vague.

What does "when I run it against AD" mean? What is "it"? What does "against AD" mean?

Why do think that a leading period generates an "access denied" message?

Write a short script that contains only the absolute minimum amount of code needed to reproduce the problem, and then tell exactly what you are running and the exact error message(s).

Remember, we can't read your mind or see your screen.

You need to put forth the effort to ask a good question.

jrv is also correct that this is not a "fix this code" service. This forum is for scripting questions. For us to be able to answer a question, you need to ask a specific question.

August 21st, 2015 2:08pm

The issue is that when I run it against AD if the file name has a period(.) in front of it I get access denied. Is there a way to get around it?

This command will create a folder with a leading full stop.

md \\?\d:\.ABC

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 2:12pm

The issue is that when I run it against AD if the file name has a period(.) in front of it I get access denied. Is there a way to get around it?

This command will create a folder with a leading full stop.

md \\?\d:\.ABC

Folders do  not have a size.  YOu should not use the device interface to create folders as it bypasses many OS protections. 

New-Item  d:\.ABC -ItemType Directory

This create a folder with a leading .  YOu cannot measuer it because folders do not have a size property.

Get-ChildItem c:\folder -recurse -File | Measure-Object -sum length

This calculates the correct size for all folders including folders with leading dots.

August 21st, 2015 5:09pm

The issue is that when I run it against AD if the file name has a period(.) in front of it I get access denied. Is there a way to get around it?

This command will create a folder with a leading full stop. A similar syntax lets you examine the contents of a folder.

md \\?\d:\.ABC


Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 6:07pm

The issue is that when I run it against AD if the file name has a period(.) in front of it I get access denied. Is there a way to get around it?

This command will create a folder with a leading full stop. A similar syntax lets you examine the contents of a folder.

md \\?\d:\.ABC


August 21st, 2015 6:07pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics