Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

up vote 5 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.

share|improve this answer
1  
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
add comment

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

share|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
add comment

Try the DISKUSE.EXE tool from the Windows 2k3 resource kit, with command line options.
The options below scan the H: drive for files owned by mydomain\johnsmith, and output their size the day it was created, and full path to c:\tmp\files.txt

diskuse H:\ /f:c:\tmp\files.txt /u:mydomain\johnsmith /s/t/d:c /v

The output looks like:

DiskUse Output from 11/05/2013 at 09:43:19
------------------------------------------

User: mydomain\johnsmith
SpaceUsed: 5535722202

    4,689,108,412 : 11/03/2013 : h:\home\johnsmith\files\meninblack3.mp4
              169 : 07/06/2012 : h:\home\johnsmith\files\somefile.doc
              <snip>
share|improve this answer
add comment

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:\

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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