Re: Disk Quota fails to get all information
From: Kirk Batzer (kbatzer_at_rutgers.edu)
Date: 12/15/04
- Previous message: Torgeir Bakken \(MVP\): "Re: Problem with dsofile.dll and vbscript"
- In reply to: name: "Re: Disk Quota fails to get all information"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 14:20:43 -0500
Here is the scam script in VB. It almost straight out of the Microsoft
scripting guide. This works fins on a server with only a few files,
directories. When run on a file server with many different file shares, it
doesn't get all the user information. When run repeatly, it may sometimes
get more or less information.
Kirk
===========================================================
Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
colDiskQuotas.Initialize "C:\", True
For Each objUser in colDiskQuotas
Wscript.Echo "QuotaEntry ID: " & objUser.ID
Wscript.Echo "Logon name: " & objUser.LogonName
Wscript.Echo "Account Status: " & objUser.AccountStatus
Wscript.Echo "Display Name: " & objUser.DisplayName
Wscript.Echo "Quota limit: " & objUser.QuotaLimit
Wscript.Echo "Quota threshold: " & objUser.QuotaThreshold
Wscript.Echo "Quota used: " & objUser.QuotaUsed
Next
====================================
"name" <nospam@user.com> wrote in message
news:OItbj7m4EHA.3504@TK2MSFTNGP12.phx.gbl...
> Post your "vb" script and there may be some response.
>
> Have not seen many "vb" scripts lately actually.
>
> ===========
>
> Try vbs or some similar.
>
> Are you a consultant working for some
> city government office or such.
>
> Guess you are not worth the salary.
>
>
>
>
>
> "Kirk Batzer" <kbatzer@rutgers.edu> wrote in message
> news:O9nMfYt3EHA.3616@TK2MSFTNGP11.phx.gbl...
>> Hello,
>>
>> I've been able to run this perl Disk Quota script on PCs to get disk
>> quota
>> information. However, when I run this on a file server (Win2000), with
> 100+
>> user file shares, the process is unable to get all the user information.
> It
>> only returns information on two or three users. I tried adding a
> "wait",
>> using a sleep, after initializing the "DiskQuota" Object, but this does
> not
>> help. I've also tried a similar script written in VB and get the same
>> results.
>>
>> Any help or comments would be appreciated.
>>
>> Script:
>> ==================================
>> use Win32::OLE qw(in);
>> my $SLEEP = shift;
>> my $colDiskQuotas = Win32::OLE->new('Microsoft.DiskQuota.1');
>> $colDiskQuotas->Initialize('E:\\', 0);
>>
>> sleep($SLEEP);
>> foreach my $objUser (in $colDiskQuotas) {
>> print 'QuotaEntry ID: ' . $objUser->ID, "\n";
>> print 'Logon name: ' . $objUser->LogonName, "\n";
>> print 'Account Status: ' . $objUser->AccountStatus, "\n";
>> print 'Display Name: ' . $objUser->DisplayName, "\n";
>> print 'Quota limit: ' . $objUser->QuotaLimit, "\n";
>> print 'Quota threshold: ' . $objUser->QuotaThreshold, "\n";
>> print 'Quota used: ' . $objUser->QuotaUsed, "\n\n";
>> }
>>
>>
>>
>> Script OUTPUT:
>> ==================================
>> QuotaEntry ID: 1
>> Logon name: BUILTIN\Administrators
>> Account Status: 0
>> Display Name:
>> Quota limit: -1
>> Quota threshold: -1
>> Quota used: 19408290816
>>
>> QuotaEntry ID: 2
>> Logon name: NANTUCKET\kbatzer
>> Account Status: 0
>> Display Name: Kirk Batzer
>> Quota limit: 838860800
>> Quota threshold: 734003200
>> Quota used: 0
>>
>> QuotaEntry ID: 3
>> Logon name:
>> Account Status: 5
>> Display Name:
>> Quota limit: 838860800
>> Quota threshold: 734003200
>> Quota used: 0
>>
>> QuotaEntry ID: 4
>> Logon name:
>> Account Status: 5
>> Display Name:
>> Quota limit: 838860800
>> Quota threshold: 734003200
>> Quota used: 388368384
>>
>>
>>
>> .
>> .
>> .
>>
>>
>>
>
- Previous message: Torgeir Bakken \(MVP\): "Re: Problem with dsofile.dll and vbscript"
- In reply to: name: "Re: Disk Quota fails to get all information"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|