Was just wondering if anyone knows a script or tool that can be used to find all the files which affect a user's disk quota in Windows Server 2003/2008.

Any suggestions?

link|improve this question

feedback

3 Answers

up vote 4 down vote accepted

Essentially, you need to tally the size of all files owned by you. A quick powershell hack:

[Int] $intSize = 0;
get-childitem -literalpath <rootdir> -recurse | foreach-object{ if ( ($_ | get-acl).owner -eq "<yourpc_or_domain>\<yourid>") { $intSize += $_.length } };
"Total size : " + $intSize;

...where <rootdir> is the root of the directory to check, <yourpc_or_domain> is the computer or domain of the account to check, and <yourid> is your.... errr, user ID.

link|improve this answer
Okay, that actually just shows the total size, but with a little hacking around, (my first venture into PowerShell!) I made it more what i need $path = (Read-Host "What path?"); $usr = (Read-Host "Which user?"); get-childitem -literalpath $path -recurse | Where {($_ | get-acl).owner -eq $usr} | Sort-Object length | Select-Object @{Name="Owner";Expression={($_ | get-acl).owner}},Name,Length,FullName; – eidylon Oct 29 '10 at 19:30
The next question though... the computers I want to deploy this too don't have PS installed, and chances of getting the corporate gods to install it are slim to none. Is there any way to compile this to a portable executable file? – eidylon Oct 29 '10 at 19:30
Not aware of a compiler for PS. If the users that you are querying are domain users, there's no reason why you can'y query the drives via a unc from a central pc. – Simon Catlin Nov 1 '10 at 20:50
feedback

Spacemonger 1.4 is an old graphical tool that I have used that achieves exactly that. It displays the space occupied by various files graphically. See this example.

You need to find version 1.4 though. That is the last freeware version they released. You can find it here

link|improve this answer
That looks like it would just show all files on the network drive, no? I'm looking specifically to find MY files, that are specifically affecting my quota (or replace MY with any user's logon really). – eidylon Oct 29 '10 at 18:11
Spacemonger will allow you to zoom in and out of folders so you can see what takes up the space inside of a specific older. It is not just fixed to display the root of the drive. That way you can just zoom in to C:\Documents and Settings\User and see what is taking up the space. The only requirement is that you run it as administrator. Also, it is just an executable. No installation involved. – Bourne Oct 29 '10 at 21:28
feedback

SIMPLY one line, below!

Find all files owned by a specific user: fsutil file findbysid

eg. If the user name = "fredsmith" and we want to check everywhere on the E: drive!

Type at the command line:

fsutil file findbysid fredsmith e:\

link|improve this answer
I don't see any recursion options with fsutil. How might I get it to look through subdirectories? – AlwaysLearning Dec 5 '11 at 17:03
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.