The attached script shows an example of how to modifiy a user's permissions.
Due to filters some may have, I renamed it from .vbs to .vbs.txt. Can't
remember where I got it, but I didn't write the original version..
You can customize this example to alter other registry settings such as
individual mailbox and domain settings.
So changing the default maximum size and messages of user mailboxes in a
domain would be domain with the following reg key (replace <domain name>
with the domain name in question)
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\MaxSize
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\MaxMsgs
And the same keys exist under the users as well to set user specific sizes
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\Users\<user
account>\MaxSize
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\Users\<user
account>\MaxMsgs
A good management policy might be to set all user account sizes to zero so
they inherit the default from the domain. Then set domain limits to what
you want globally.
You might also want to set
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\MaxOutboundSize
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\MaxRcv
Note that MaxOutboundSize only applies to non-virtual domains. Virtual
domains pick the limit up from the primary host.
There was also a recent discussion about setting
SOFTWARE\IPSwitch\IMail\Domains\<domain name>\NotifyPercent
Darin.
----- Original Message -----
From: "Jamie Price" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 29, 2004 9:58 AM
Subject: [IMail Forum] Size & Space Limits
Hello,
Is there a command line utility that would allow you to add
restrictions to the size of the user accounts and the number of
messages? I'm trying to retro-actively install a limit across the whole
server to prevent accounts from getting too full. Thanks!
Regards,
Jamie Price
Email: [EMAIL PROTECTED]
http://www.HostMySite.com
Get your FREE .com, .net, .org, .biz and .info domain name at
HostMySite.com!
Phone: International 302.731.4948 | Toll Free: 877-215-4678
To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
'---------------------------------------------------------------------------------------------------
' This function sets the Imail User attributes via a registry key
'
'ImailUserFlags <--Domain|-D DOMAIN NAME>
' <--User|-u USERLOGIN>
' <--Flags|-f FLAGS>
' [--help|-?]
'
'DOMAIN NAME Domain name the user belongs to (e.g. pizza.com)
'USERLOGIN Name of the user account
'FLAGS Hex value for flags to be set
'
' Hex Decimal Option
' ============================
' 1 1 Account access disabled
' 2 2 Hide from information services
' 4 4 User cannot change password
' 80 128 Web Access
' 100 256 Host Administrator
' 200 512 IMail System Administrator
' 400 1024 List Administrator
' 1000 4096 User cannot modify LDAP attributes.
'
'So, if the user's Flags value has an 8 in the second digit of the hex value (like 80,
or 180), the user has web access.
'
'
'Example 1: a full admin user ImailUserFlags -D acsfla.com -U joe -F 782
'Example 2: host admin usual settings ImailUserFlags -D acsfla.com -U john -F 182
'Example 3: regular user w/web access ImailUserFlags -D acsfla.com -U jerry -F 82
'
'---------------------------------------------------------------------------------------------------
' Force explicit declaration of all variables.
Option Explicit
'On Error Resume Next
Dim oArgs, ArgNum
Dim ArgDomain, ArgUser, ArgFlags, RegKey, WshShell
Set oArgs = WScript.Arguments
ArgNum = 0
While ArgNum < oArgs.Count
If (ArgNum + 1) >= oArgs.Count Then
Call DisplayUsage
End If
Select Case LCase(oArgs(ArgNum))
Case "--domain","-d":
ArgNum = ArgNum + 1
ArgDomain = oArgs(ArgNum)
Case "--user","-u":
ArgNum = ArgNum + 1
ArgUser = oArgs(ArgNum)
Case "--flags","-f":
ArgNum = ArgNum + 1
ArgFlags = oArgs(ArgNum)
Case "--help","-?"
Call DisplayUsage
End Select
ArgNum = ArgNum + 1
Wend
RegKey = "HKLM\Software\Ipswitch\IMail\Domains\" & ArgDomain & "\Users\" & ArgUser &
"\Flags"
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite RegKey, CInt("&h" & ArgFlags), "REG_DWORD"
If Err <> 0 Then Display "Error occurred setting " & RegKey & " to " & ArgFlags & "."
Set WshShell = Nothing
'---------------------------------------------------------------------------------
Sub Display(Msg)
WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & Msg
End Sub
Sub Trace(Msg)
WScript.Echo Now & " : " & Msg
End Sub
Sub DisplayUsage()
WScript.Echo "Usage: ImailUserFlags <--Domain|-D DOMAIN NAME>"
WScript.Echo " <--User|-u USERLOGIN>"
WScript.Echo " <--Flags|-f FLAGS>"
WScript.Echo " [--help|-?]"
WScript.Echo ""
WScript.Echo "DOMAIN NAME Domain name the user belongs to (e.g.
pizza.com)"
WScript.Echo "USERLOGIN Name of the user account"
WScript.Echo "FLAGS Hex value for flags to be set"
WScript.Echo ""
WScript.Echo " Hex Decimal Option"
WScript.Echo "
================================================"
WScript.Echo " 1 1 Account access disabled"
WScript.Echo " 2 2 Hide from information
services"
WScript.Echo " 4 4 User cannot change password"
WScript.Echo " 80 128 Web Access"
WScript.Echo " 100 256 Host Administrator"
WScript.Echo " 200 512 IMail System Administrator"
WScript.Echo " 400 1024 List Administrator"
WScript.Echo " 1000 4096 User cannot modify LDAP
attributes."
WScript.Echo ""
WScript.Echo "So, if the user's Flags value has an 8 in the second digit of
the hex value (like 80, or 180), the user has web access."
WScript.Echo ""
WScript.Echo "Example 1: a full admin user ImailUserFlags -D
acsfla.com -U joe -F 782"
WScript.Echo "Example 2: host admin usual settings ImailUserFlags -D
acsfla.com -U john -F 182"
WScript.Echo "Example 3: regular user w/web access ImailUserFlags -D
acsfla.com -U jerry -F 82"
WScript.Echo ""
WScript.Quit
End Sub
'---------------------------------------------------------------------------------