Adding disk quota record on Windows 2003 RC2... 
Author Message
 Adding disk quota record on Windows 2003 RC2...

Hello,

I am using the following script from "System Administration Scripting
Guide" to add a disk quota entry.

Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
colDiskQuotas.Initialize "C:\", True
set objUser = colDiskQuotas.AddUser("jsmith")
set objUser = colDiskQuotas.FindUser("jsmith")
objUser.QuotaLimit = 50000000

This script crashes on Windows 2003 RC2. The DrWatson log shows, that,
the crash happens somewhere in dskquota.dll

Can someone shade some light on this OR is there any other way to add
disk quota entries?

Thanks.
-Prasad



Sun, 16 Oct 2005 22:41:31 GMT  
 Adding disk quota record on Windows 2003 RC2...
I use this script to set quotas

Public Function SetQuota(ByVal userName As String, ByVal qLimit _
                                As Integer, ByVal location As String)
As Object
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

must be changed to match your Domain
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

        Dim colDiskQuotas As Object
        Dim qWarning As Integer
        Dim QuotaUser As Object

        'userName ex: ChrisP
        'qLimit = variables.item(1)     'ex: 50
        'location = variables.item(2)   'ex: \\tundra\c
        location = location & "$\\"     'must have the $\\ on the end

        Const ENABLE_QUOTAS = 2
        colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
        colDiskQuotas.Initialize(location, True)
        colDiskQuotas.QuotaState = ENABLE_QUOTAS

        colDiskQuotas.Adduser(userName)

        qLimit = qLimit * 1024 * 1024
        qWarning = qLimit * 0.8

        QuotaUser = colDiskQuotas.FindUser(colDiskQuotas.TranslateLogonNameToSID(userName
& DomainSuffix))

        QuotaUser.QuotaLimit = qLimit
        QuotaUser.QuotaThreshold = qWarning
    End Function

Quote:

> Hello,

> I am using the following script from "System Administration Scripting
> Guide" to add a disk quota entry.

> Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
> colDiskQuotas.Initialize "C:\", True
> set objUser = colDiskQuotas.AddUser("jsmith")
> set objUser = colDiskQuotas.FindUser("jsmith")
> objUser.QuotaLimit = 50000000

> This script crashes on Windows 2003 RC2. The DrWatson log shows, that,
> the crash happens somewhere in dskquota.dll

> Can someone shade some light on this OR is there any other way to add
> disk quota entries?

> Thanks.
> -Prasad



Wed, 26 Oct 2005 04:45:36 GMT  
 Adding disk quota record on Windows 2003 RC2...
I use VB.NET and I use this code.

Public Function SetQuota(ByVal userName As String, ByVal qLimit _
                                As Integer, ByVal location As String)
As Object
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

must be changed to match your Domain
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

        Dim colDiskQuotas As Object
        Dim qWarning As Integer
        Dim QuotaUser As Object

        'userName ex: ChrisP
        'qLimit = variables.item(1)     'ex: 50
        'location = variables.item(2)   'ex: \\tundra\c
        location = location & "$\\"

        Const ENABLE_QUOTAS = 2
        colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
        colDiskQuotas.Initialize(location, True)
        colDiskQuotas.QuotaState = ENABLE_QUOTAS

        QuotaUser = colDiskQuotas.Adduser(userName)

        qLimit = qLimit * 1024 * 1024
        qWarning = qLimit * 0.8

I used to use the following 2 lines but kept having syncing problems
so i commented them out and now use the QuotaUser =
colDiskQuotas.adduser from above instead.
        'QuotaUser =
colDiskQuotas.FindUser(colDiskQuotas.TranslateLogonNameToSID(userName
& DomainSuffix))

        QuotaUser.QuotaLimit = qLimit
        QuotaUser.QuotaThreshold = qWarning
    End Function

Quote:

> Hello,

> I am using the following script from "System Administration Scripting
> Guide" to add a disk quota entry.

> Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")
> colDiskQuotas.Initialize "C:\", True
> set objUser = colDiskQuotas.AddUser("jsmith")
> set objUser = colDiskQuotas.FindUser("jsmith")
> objUser.QuotaLimit = 50000000

> This script crashes on Windows 2003 RC2. The DrWatson log shows, that,
> the crash happens somewhere in dskquota.dll

> Can someone shade some light on this OR is there any other way to add
> disk quota entries?

> Thanks.
> -Prasad



Wed, 26 Oct 2005 05:20:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Windows 2003 Server WSH

2. VBScript User Creation Issues Under Windows 2003

3. WSH - Windows 2003 Server

4. adjusting disk quota settings

5. disk quotas and files ownership

6. win2K disk quotas from script

7. Check Disk Quota for specific User

8. Disk Quotas

9. adjusting disk quota settings

10. adjusting disk quota settings

11. Check Win2K Disk Quota's?

12. disk quotas and files ownership

 

 
Powered by phpBB® Forum Software