Jump to content

Recommended Posts

Posted

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

'Quota', 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/...

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 &
"<br />"
Response.Write "Limit: " & vbTab & objQuota.Limit & "<br />"
Response.Write "Quota Volume: " & vbTab & objQuota.QuotaVolume & "<br
/>"
Response.Write "Status: " & vbTab & objQuota.Status & "<br />"
Response.Write "User: " & vbTab & objQuota.User & "<br />"
Response.Write "Warning Limit: " & vbTab & objQuota.WarningLimit &
"<br />"
Next


Posted
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

'Quota', 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/...

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 &
"<br />"
Response.Write "Limit: " & vbTab & objQuota.Limit & "<br />"
Response.Write "Quota Volume: " & vbTab & objQuota.QuotaVolume & "<br
/>"
Response.Write "Status: " & vbTab & objQuota.Status & "<br />"
Response.Write "User: " & vbTab & objQuota.User & "<br />"
Response.Write "Warning Limit: " & vbTab & objQuota.WarningLimit &
"<br />"
Next

I do not know if this will help but here is a link with a script and it explains how it works.

How Can I Retrieve Disk Quota Information for a Single User?

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...