Here's a batch file using diruse.exe from the reskit I wrote a while ago...
-----------------copy below here--------------
@ECHO OFF
REM NAME: Usage.cmd
REM
REM PURPOSE: This is a batch job to determine any user with over 300MB
REMof disk space usage in their home drive. The output should
REM be redirected to a log file in the scheduler if you run it.
REM
REM REQ: You need to have the resource kit installed on the machine
REM you will be running this from, or it won't work!
REM
REM BY: Jordan Arendt
REM
REM DATE: April 1, 1999
REM
REM UPDATED:
REM ******** Drive Mappings ***********************
REM Let's map some drives. o will be the home directories we want to run
REM the reports on, q will be the dir we are going to log to. (these shares need
REM to be created)
net use o: \\fileserver\home$
net use q: \\logserver\usage$
REM Let's write the date to the log file.
date /T > q:\usage.log
REM Wow, that wasn't too hard. Now let's run diruse and find those disk hogs!
REM Note that diruse comes with NT Resource Kit...
REM DIRUSE COMMAND Breakdown:
REM we are gonna use MB (/M)
REM we are gonna sperate thousands of MB (/,)
REM we are gonnause the top level dirs. Don't want to check subdirs.(/*)
REM we are gonna show only the people in excess of (/D)
REM we are gonna set the limit at 500MB (/Q:500)
@ECHO ON
diruse /M /, /* /D /L /Q:250 O:
REM OK, here it get's tricky. We are going to append to a file and then
REM copy it back to the original....
copy q:\usage.log+diruse.log q:\usage2.log
del q:\usage.log
rename q:\usage2.log usage.log
REM OK, let's do a bit of clean up...
del diruse.log
REM OK, let's finish off the cleanup by unmapping the drives
net use o: /delete
net use q: /delete