Re: Disk Quota fails to get all information

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kirk Batzer (kbatzer_at_rutgers.edu)
Date: 12/15/04

  • Next message: Gordon: "Re: Regular Expression question"
    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
    >>
    >>
    >>
    >> .
    >> .
    >> .
    >>
    >>
    >>
    >


  • Next message: Gordon: "Re: Regular Expression question"

    Relevant Pages

    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
      (perl.beginners)
    • Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Regarding a selection for mobile code/scripting language
      ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
      (Vuln-Dev)
    • Re: HTTPSConnection script fails, but only on some servers (long)
      ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
      (comp.lang.python)