Thursday, February 10, 2011

Disk-Quota: List files owned by a user

Quick way:
Open Quota Entries > pretend to delete entry of the user, you will be presented with the list of user's files

Official way:
You have to download "Windows Server 2003 Resource Kit Tools":
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en
Next just read help about "Diskuse.exe: User Disk Usage Tool":
User Disk Usage Tool (DiskUse) is a command-line tool that scans a single directory, a directory tree, or an entire drive and reports the amount of space used by each user or all users. The output for this tool is displayed in the command window, or is sent to a file in table or text format. DiskUse can also list all the files owned by a user or users, filtered in a variety of ways.
Source:
www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_20979479.html

DiskUse syntax:

/f:         =   Store Results in
/e:         =   Store Errors in
/u:         =   Only Search for
/s                =   Include Subdirectories
/t                =   Table Format
/w                =   Unicode Output (Wide Characters)
/q                =   Quiet Mode
/?|h              =   This Screen
-----------
/r:         =   Restriction are stored in
/o                =   Show Only Users Over Limit
-----------
/v                =   Verbose Mode
/d:a|c|w          =   Date to Display     Access | Create | Write
/n:       =   Display Largest Files Per User
/x:       =   Display Files of Bytes or Larger


DiskUse sample usage:
diskuse f:\public /f:result.txt /u:DOMAIN\user1 /s /t /d:w /v
/v needed to display files
/d:a seems inaccurate because (sometimes) it gives the date of the scanning by DiskUse
Result.txt can then imported to Excel
(dont forget to select correct date format for date column)
Optional formula that useful to split path from filename:
Path:
=LEFT(C1;FIND("~";SUBSTITUTE(C1;"\";"~";LEN(C1)-LEN(SUBSTITUTE(C1;"\";"")))))
Filename:
=RIGHT(C1;LEN(C1)-FIND("~";SUBSTITUTE(C1;"\";"~";LEN(C1)-LEN(SUBSTITUTE(C1;"\";"")))))

1 comment:

  1. You should try Directory Report
    http://www.file-utilities.com
    It presents a GUI screen like the MS-Explorer
    It can show total files per user and
    It can filter to only show a particular user's files

    ReplyDelete