Jump to content

Recommended Posts

Posted
We use a windows server 2003 r2 built in quota system, not NTFS Disk quota. Does anyone know a way of notfying users when they run low or out of disk space, we would like to use a pop-up. I know this has been discussed in previous posts, but I cnould not find any definfte solution, and most of them do not use the quots system that R2 Uses. I would appreciate any advice that you can give me
Posted
Forgot to mention that none of our students have school e-mail address, hence we cannont send them e-mails, I thinik that the command option would be the best way, but I cannont get it to work
Posted

Hey molesm,

 

we have been looking at something like that here but as of yet we haven't implemented it because we don't want to slacken the security settings to enable the kids to run scripts ... could be messy.

 

if you or anyone else knows of a way to do this without scripts then it would be very much appreciated.

 

sorry its not very helpful :?

 

cheers

andy

Posted

I setup our login script to measure the disk usage of each student at login. Then display the details in a popup box. We use kixtart scripts .....

 

Dim $quota
Dim $year
Dim $restrict
Dim $defprint
Dim $diskspace

;defines print quota and year group based on active directory group

IF InGroup("2006_07")
$quota = "50"
$year = "Year 7"
goto yrend
EndIf
IF InGroup("2005_06")
$quota = "100"
$year = "Year 8"
goto yrend
EndIf
IF InGroup("2004_05")
$quota = "150"
$year = "Year 9"
goto yrend
EndIf
IF InGroup("2003_04")
$quota = "250"
$year = "Year 10"
goto yrend
EndIf
IF InGroup("2002_03")
$quota = "500"
$year = "Year 11"
goto yrend
EndIf
IF InGroup("2001_02","WSELC_2001_02")
$quota = "200"
$year = "Post 16"
goto yrend
EndIf
IF InGroup("2000_01","1999_00","1998_99","WSELC_2000_01","WSELC_1999_00")
$quota = "300"
$year = "Post 16"
goto yrend
EndIf
IF InGroup("ICTStaff")
$quota = "unlimited"
$year = "ICT Staff"
goto yrend
EndIf
IF InGroup("staff")
$quota = "100"
$year = "Staff"
goto yrend
EndIf

:yrend

;runs a prog that calculates the space used in the users home folder (z:) and outputs to txt file
Shell "%COMSPEC% /C \\server\folder\dirsize.exe z:\* >%TEMP%\dirsize.txt"

;reads the correct line from the prog output txt file

If Exist ("%TEMP%\quota.txt") ;check if file exists
    Del "%TEMP%\quota.txt"  ; del if file exits
EndIf

$ = Open (2,"%TEMP%\quota.txt",5) 
$ = Open (1, "%TEMP%\dirsize.txt")

$Line = ReadLine (1)
Do 
    If InStr ($Line,"Total file size (MB):")
         $NewLine = Trim (SubStr($Line,22,8))
         $ = WriteLine (2, $NewLine + @CRLF)
    EndIf
    $Line = ReadLine (1)
Until @ERROR = -1

$ = Close (1) 
Del "%TEMP%\dirsize.txt"

$ = Close (2)

Open (3, "%TEMP%\quota.txt", 2)

$diskspace = Readline (3)


;gets restrictions as stored in users full name in AD
IF @FullName = ""
$restrict = "no resrictions on your account"
Else
$restrict = @Fullname
EndIf


;displays message box
MESSAGEBOX ("@userid - $year @CRLF@CRLFLogged on to computer: @wksta@CRLF@CRLFDefault Printer: $defprint @CRLF@CRLFDisk space used: $diskspace of $quota MB disk quota available@CRLF@CRLFRestrictions: $restrict@CRLF@CRLFDate: @Day @MDayNo @Month @Year @TIME", "Logon Information", 4160, 10)

 

dirsize.exe is a freeware tool from Tools4ever (they call it T4eDirSize)

Posted
I thinik that the command option would be the best way, but I cannont get it to work

 

Has anyone actually seen this option being used? As best I can tell it will run a script centrally, and if you wanted to inform the user that the quota has exceeded, you will need the script to send a message or something to the user remotely... thats assuming the detection of quota violations are instant and not scheduled. Is that right?

Posted
tanks for your input Steve, I am fairley new to scripts, but your script to me does not seam to be using the FSRM of Win server 2003 r2, apeo I think that you are tight but not sure how to script this,a nd every time I hve tried to create a script I get an error message when I try to assign it
Posted

I started a thread at http://edugeek.net/index.php?name=Forums&file=viewtopic&t=4772 a few days ago and got a script together that nearly worked.

 

The problem is that WSH has certain security built into it that prvents the key method from running :(

 

If anyone can fettle that script so that a regular user can run, please let me know.

 

BTW - Don't know about the R2 command thingy but you don't have to enable the Messenger service or anything daft like that do you?

Posted
apeo I think that you are tight

 

Thats abit harsh aint it?? :lol:

 

@molesm: If I have time I may give it a bash but what is the error you are getting?

 

@Ric_: Thanks for your script, but just to clarify it is a login script yes and if that is the case it will only display the info when they login.

Posted

The error is the command specifed is under an inscure folder path

This is beacsue builtin\users has perrmsions to it on the DC

Posted

The script I've shown doesn't use any of R2's quota system.

 

I've predefined the quota limits per year group, and the script goes off and calculates the space used.

 

I looked at a few alternatives, but this at the time was the best i could come up with.

 

One problem is that the drivespace reported by windows still referes to the entire space available - not the remaining quota.

 

There is a command line tool within R2: from server :\>dirquota quota freespace /path:\\share\userfolder

 

This gives the users % usage. Only trouble is I've only been able to run this on the server, and its extremely slow.

  • 1 month later...
Posted
I started a thread at http://edugeek.net/index.php?name=Forums&file=viewtopic&t=4772 a few days ago and got a script together that nearly worked.

 

The problem is that WSH has certain security built into it that prvents the key method from running :(

 

If anyone can fettle that script so that a regular user can run, please let me know.

 

BTW - Don't know about the R2 command thingy but you don't have to enable the Messenger service or anything daft like that do you?

 

I think you would need the messenger service enabled in order to send messages to remote machines, unless you know of some other way aside from replying on a 3rd party app.

 

Surely when you run a logon script its run with system privs so it shouldnt matter about if its a student or admin logging on ?

 

I must be missing something here :)

Posted
Surely when you run a logon script its run with system privs so it shouldnt matter about if its a student or admin logging on ?

 

I must be missing something here :)

 

Login scripts run with slightly elevated user priviledges. Only startup/shutdown scripts run with system priveldges.

Posted
so why not just make it a startup script so that it has system privs and see if that helps with that ?

 

Because it then wouldn't br running at logon.... hence no knowledge of a particular user and no ability to prompt the user to delete files.

Posted

Any chance you can post your wsh example so I can have a look at it and what happens or what error message do you get ( If any ) with this wsh script. I'm guessing its obviously something to do with the end users permissions ie with being a student or w/e....

 

Just so I can see what your doing exactly.

Posted

Ric_,

doesn't that forum just apply to NTFS Quotas and not R2 quotas, also the remiang disk space is not that good as it sometimes shows the entire HDD rather than their own space

 

molesm

Posted

Yes Ric,

but as I mentioed eariler we do not have any handy exchange servers, or other student e-mail addreess, yet although there could be plans in the future, which is why I would like a pop-up messages or bubbles of some kind.

 

molesm

  • 3 months later...
Posted

Just thought I'd bump this post and see if anyone has had any brainwaves on the subject since.

 

I just implimented a new R2 based file server over the easter 'break' there and I finished off tweaking year group based quotas today. I'm now at the point of finding a way to notify users of they're quota. I used to be happy enough that they could see they're free space by looking at they're mapped network drive but with R2 quotas its reporting the full volume free space not the quota space like it used to with NTFS quotas.

 

I'm wondering about using the execute command option coupled with the % limit events you can set in R2. Obviosuly net send would be an option but I don't need to tell any of you how much I loath the idea of enabling messenger service on client PCs. Has anyone thought of another way maybe a 3rd party secure messenging client that could be run on server and client that is accessable from the command line?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...