Disk Quotas - R2 - Storage

This is a discussion on Disk Quotas - R2 - Storage ; Hi, I am running a Storage Server 2003 R2 x64 box, and am making use of the MMC based management for stuff like File Screening and Disk Quotas etc. I am trying to develop an .asp page that show users ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Disk Quotas - R2

  1. Disk Quotas - R2

    Hi,

    I am running a Storage Server 2003 R2 x64 box, and am making use of the MMC
    based management for stuff like File Screening and Disk Quotas etc.

    I am trying to develop an .asp page that show users their quota status. Now
    the below script kinda works, in that no errors appear, but it's not finding
    any info for the specified user (in this case Joe Bloggs) and doesn't work
    for any user I specify.

    Is this because i'm using the MMC snap-in for Quota management and not going
    through the other way of right clicking the drive in question and clicking
    'Quotas', as this show no entries. If so, can the script me modified to look
    at the MMC-base quotas instead. Or does something else need to be done.

    Thanks/...

    Code:
    strComputer = "servername"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    Set colDiskQuotas = objWMIService.ExecQuery("Select * from Win32_DiskQuota
    Where User='Win32_Account.Domain=""domainname"",Name=""Joe Bloggs""'")
    
    For each objQuota in colDiskQuotas
    Response.Write "Disk Space Used: " & vbTab &  objQuota.DiskSpaceUsed &
    ""
    Response.Write "Limit: " & vbTab &  objQuota.Limit & ""
    Response.Write "Quota Volume: " & vbTab &  objQuota.QuotaVolume & "
    " Response.Write "Status: " & vbTab & objQuota.Status & "" Response.Write "User: " & vbTab & objQuota.User & "" Response.Write "Warning Limit: " & vbTab & objQuota.WarningLimit & "" Next

  2. Re: Disk Quotas - R2

    Does the code work if you run it in CSCRIPT from the console (replace
    Response.Write with WScript.Echo)?


    Pat


    "Andy Smith" wrote in message
    news:014E2E25-AD49-419E-8DE1-9ED8B1C195BF@microsoft.com...
    > Hi,
    >
    > I am running a Storage Server 2003 R2 x64 box, and am making use of the
    > MMC
    > based management for stuff like File Screening and Disk Quotas etc.
    >
    > I am trying to develop an .asp page that show users their quota status.
    > Now
    > the below script kinda works, in that no errors appear, but it's not
    > finding
    > any info for the specified user (in this case Joe Bloggs) and doesn't work
    > for any user I specify.
    >
    > Is this because i'm using the MMC snap-in for Quota management and not
    > going
    > through the other way of right clicking the drive in question and clicking
    > 'Quotas', as this show no entries. If so, can the script me modified to
    > look
    > at the MMC-base quotas instead. Or does something else need to be done.
    >
    > Thanks/...
    >
    >
    Code:
    > strComputer = "servername"
    > Set objWMIService = GetObject("winmgmts:" _
    >    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    >
    > Set colDiskQuotas = objWMIService.ExecQuery("Select * from Win32_DiskQuota
    > Where User='Win32_Account.Domain=""domainname"",Name=""Joe Bloggs""'")
    >
    > For each objQuota in colDiskQuotas
    >     Response.Write "Disk Space Used: " & vbTab &  objQuota.DiskSpaceUsed &
    > ""
    >     Response.Write "Limit: " & vbTab &  objQuota.Limit & ""
    >     Response.Write "Quota Volume: " & vbTab &  objQuota.QuotaVolume & "
    />" > Response.Write "Status: " & vbTab & objQuota.Status & "" > Response.Write "User: " & vbTab & objQuota.User & "" > Response.Write "Warning Limit: " & vbTab & objQuota.WarningLimit & > "" > Next >



  3. Re: Disk Quotas - R2

    No it doesn't - I wrote it like that to begin with, then modified it to suit
    ASP.

    I must repeat though that if I set 'normal' disk quotas, the script works
    fine, both in CScript and ASP, so it appears the R2 quota management MMC
    works independently to the other way!!!

    "Pat [MSFT]" wrote:

    > Does the code work if you run it in CSCRIPT from the console (replace
    > Response.Write with WScript.Echo)?
    >
    >
    > Pat
    >
    >
    > "Andy Smith" wrote in message
    > news:014E2E25-AD49-419E-8DE1-9ED8B1C195BF@microsoft.com...
    > > Hi,
    > >
    > > I am running a Storage Server 2003 R2 x64 box, and am making use of the
    > > MMC
    > > based management for stuff like File Screening and Disk Quotas etc.
    > >
    > > I am trying to develop an .asp page that show users their quota status.
    > > Now
    > > the below script kinda works, in that no errors appear, but it's not
    > > finding
    > > any info for the specified user (in this case Joe Bloggs) and doesn't work
    > > for any user I specify.
    > >
    > > Is this because i'm using the MMC snap-in for Quota management and not
    > > going
    > > through the other way of right clicking the drive in question and clicking
    > > 'Quotas', as this show no entries. If so, can the script me modified to
    > > look
    > > at the MMC-base quotas instead. Or does something else need to be done.
    > >
    > > Thanks/...
    > >
    > >
    Code:
    > > strComputer = "servername"
    > > Set objWMIService = GetObject("winmgmts:" _
    > >    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    > >
    > > Set colDiskQuotas = objWMIService.ExecQuery("Select * from Win32_DiskQuota
    > > Where User='Win32_Account.Domain=""domainname"",Name=""Joe Bloggs""'")
    > >
    > > For each objQuota in colDiskQuotas
    > >     Response.Write "Disk Space Used: " & vbTab &  objQuota.DiskSpaceUsed &
    > > ""
    > >     Response.Write "Limit: " & vbTab &  objQuota.Limit & ""
    > >     Response.Write "Quota Volume: " & vbTab &  objQuota.QuotaVolume & "
    > />" > > Response.Write "Status: " & vbTab & objQuota.Status & "" > > Response.Write "User: " & vbTab & objQuota.User & "" > > Response.Write "Warning Limit: " & vbTab & objQuota.WarningLimit & > > "" > > Next > >

    >


+ Reply to Thread