Hi there, this one is baffling me.
I'm using a script to create Exchange quotas, which is using ADO to hook into LDAP. When I "hardcode" the quota size, the script works perfectly. When I try to use variables (after getting input defining the quota size variable), the script fails with an "80004005" error - which I just assume something is wrong with the data that we're trying to perform the LDAP function with.
Here are the parts of the script doing stuff:
Where the script fails is on the lines that specify group.Put "mDBStorageQuota", WarningAmount and the subsequent line. If the script reads group.Put "mDBStorageQuota", 358400, then it works fine.
Is there some kind of string vs numeric mismatch going on? If so, how does one specify the numeric value?
I'm using a script to create Exchange quotas, which is using ADO to hook into LDAP. When I "hardcode" the quota size, the script works perfectly. When I try to use variables (after getting input defining the quota size variable), the script fails with an "80004005" error - which I just assume something is wrong with the data that we're trying to perform the LDAP function with.
Here are the parts of the script doing stuff:
Code:
'... define variables and const MB=1024
strGrpName= InputBox("Enter the name of the group you wish to set quotas for")
QuotaAmount=InputBox("Enter the quota amount in MB. If nothing is input, the quota will be set to 300MB.")
If QuotaAmount="" Then QuotaAmount=300
WarningAmount = QuotaAmount*0.90
QuotaAmount = QuotaAmount*MB
WarningAmount = WarningAmount*MB
'... open ADODB.Connection
'... <snipped>
group.Put "description", "Admin modified via Script"
group.Put "mDBUseDefaults", "FALSE"
group.Put "mDBStorageQuota", WarningAmount
group.Put "mDBOverQuotaLimit", QuotaAmount
'.... etc, close connections
Where the script fails is on the lines that specify group.Put "mDBStorageQuota", WarningAmount and the subsequent line. If the script reads group.Put "mDBStorageQuota", 358400, then it works fine.
Is there some kind of string vs numeric mismatch going on? If so, how does one specify the numeric value?