To all:
I am using CDO to programatically obtain mailbox sizes for Exchange 5.5
mailboxes, following the "Extended MAPI" method described in Microsoft KB
article http://support.microsoft.com/?id=320071. There is a subset of these
mailboxes that do not have an oInfoStore.Name beginning with "Mailbox - " but
instead have one named "Private Folders". The script fails when trying to
use the technique to obtain its size.
The code fails at the iSize = ... line.
The code I'm using is:
For Each oInfoStore In oInfoStores
'WScript.Echo oInfoStore.Name
If ((InStr(1, oInfoStore.Name, "Mailbox - ", 1) <> 0) Or _
(InStr(1, oInfoStore.Name, "Private Folders", 1) <> 0)) Then
On Error Resume Next
iSize = oInfoStore.Fields(&HE080003) / 1024
If (Err.Number <> 0) Then
WScript.Echo "Error " & CStr(Err.Number)
WScript.Echo Err.Description
iSize = -1
ElseIf (iSize >= 0) Then
iSize = CLng(iSize) 'Convert to KB.
Else 'If size is less than zero, then it's probably over 2GB, so add
4GB to it.
'This assumes that the size isn't over 4GB, in which case the
result will be wrong.
iSize = CLng(iSize) + 4194304
End If
Err.Clear
iNumMessages = oInfoStore.Fields(&H36020003)
If (Err.Number <> 0) Then
iNumMessages = -1
End If
Err.Clear
On Error GoTo 0
Exit For
End If
Next
Have any of you seen this problem and, if so, can you explain it to me and
offer a workaround?