none
Finding users home directory size to include Linux files. RRS feed

  • Question

  • 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.

    Friday, August 21, 2015 5:00 PM

Answers

  • 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.


    \_(ツ)_/

    • Marked as answer by Richardlaw Tuesday, August 25, 2015 1:15 PM
    Friday, August 21, 2015 5:33 PM

All replies

  • 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.


    \_(ツ)_/

    • Marked as answer by Richardlaw Tuesday, August 25, 2015 1:15 PM
    Friday, August 21, 2015 5:33 PM
  • 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.


    -- Bill Stewart [Bill_Stewart]

    Friday, August 21, 2015 6:04 PM
    Moderator
  • 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


    Friday, August 21, 2015 6:07 PM
  • 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.


    \_(ツ)_/

    Friday, August 21, 2015 9:04 PM