Announcement

Collapse
No announcement yet.

Disk quota popup warning

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disk quota popup warning

    Working for a school board, I have to be strict on my network policies otherwise the kids will fill up my 2 TB of the data storage in no time.

    Here is my servers configuration:
    I have 2 partitions on the win2003 server:
    - C: is for all the system files
    - D: is for application, shared folder and home drive. Each user has a home drive on this partition (mapped as H: )
    I enable quotas on the server’s D: drive (100mb for each student). This includes their home drive as well as any shared folder where they have right to save
    I wanted to warn them when they are reaching the “High water mark” on their quota.
    What I found is that on the workstation, their H: drive reports their full quota on the server's data drive and I used this feature to create a popup at login.
    What this script does is:
    - Disk quota less than 90% full: just popup a reminder of the policies
    - Disk quota over 90%: popup an information screen with the status of their quota
    - Disk full: popup with information that they can only delete files.
    Here is the script:

    '************************************************* ****************
    '* Bertrand Vogel *
    '* Popup windows if user reaches more than 90% of its disk quota *
    '* Written for HRSB *
    '************************************************* ****************
    set oFs = WScript.CreateObject("Scripting.FileSystemObject")
    set oDrives = oFs.Drives
    for each oDrive in oDrives
    if odrive.driveletter = "H" then
    percent_used_tmp= (oDrive.freeSpace /oDrive.TotalSize)*100
    res1=instr(percent_used_tmp,".")
    percent_used = Left(percent_used_tmp,res1 + 2)
    if percent_used < 100 then
    percent_used= 100 - percent_used
    end if
    if percent_used = 100 then
    MsgBox " Only curriculum related material is to be saved on the server."& vbcrlf & _
    " "& vbcrlf & _
    " WARNING!" & vbcrlf & _
    " You are out of disk space on the server! ." & vbcrlf & _
    "You must delete unnecessary files on move them to a removable storage device." & vbcrlf & _
    " You are not able to save files on the server at this time.",48, "You are out of disk space on the server!"

    elseif percent_used > 90 then
    MsgBox " Only curriculum related material is to be saved on the server."& vbcrlf & _
    " "& vbcrlf & _
    " WARNING!" & vbcrlf & _
    " You are have utilized " & percent_used & "% of your allocated disk space on the server." & vbcrlf & _
    "Please delete unnecessary files or move them to removable storage device.",48, "You are running out of disk space on the server"

    elseif percent_used < 90 then
    msgbox "Only curriculum related material is to be saved on the server.",48, "Reminder"
    end if
    end if
    next
    Last edited by bertv; 8th September 2008, 21:34.
Working...
X