Listing 1: Groupquota.vbs Begin Comment ' Force the script to use only defined variables. End Comment Option Explicit Dim sUserName, oGroup, sDomain, sDrive, sGroup Dim WshNetwork, colDiskQuotas, oMember, oUser Begin Comment ' Print the instructions for the user. End Comment If WScript.Arguments.Count <1 Then Call Help Begin Comment ' Define the variables. End Comment sGroup = WScript.Arguments(0) sDrive = WScript.Arguments(1) BEGIN CALLOUT A Set WshNetwork = WScript.CreateObject("WScript.Network") sDomain = WshNetwork.UserDomain END CALLOUT A Begin Comment ' Create a quota collection and initialize its connection ' to the selected drive. End Comment Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1") Begin Callout B colDiskQuotas.Initialize sDrive&":\", True End Callout B Begin Callout C colDiskQuotas.QuotaState = 2 End Callout C Begin Comment ' Connect to the object representing the group. End Comment Set oGroup = GetObject _ ("WinNT://" & sDomain & "/" & sGroup &", group") Begin Comment ' Apply the quota to each member of that group. End Comment For each oMember in oGroup.Members WScript.Echo oMember.Name sUserName = oMember.Name Begin Callout D Set oUser = colDiskQuotas.AddUser(sUserName) End Callout D Set oUser = colDiskQuotas.FindUser(sUserName) oUser.QuotaThreshold = 9000000 oUser.QuotaLimit = 10000000 Next Sub Help WScript.Echo "Instructions" WScript.Echo "This script sets up disk quotas for a group on" WScript.Echo "a named disk. To run the script, type the name" WScript Echo "of a group (using quotation marks if its name" WScript.Echo "has more than one word) and the drive letter." WScript.Quit End Sub