Hi, I have a CDO (VB .Net 2003) program (code segment below) that loops through mailboxes and collects their sizes. The code works well until it encounters a mailbox of greater than 2GB. In those cases the oField.Value, which is an integer, contains a negative number. I have two questions: 1. How are the negative values converted to the actual size? Adding 4GB to the value does not result in the value shown in Exchange System Manager (Exchange 2003 SP1.) Adding 4GB results in a sum that is wrong by 9,435,055 bytes. 2. What does oField.Value contain when the mailbox is larger than 4GB since it is a 32 bit integer and can only contain values between +2147483647 and -2147483648? Thank you, Scott Lemen This code is right out of KB article 320071 Const OneKiloByte = 1024 Dim oInfoStores As MAPI.InfoStores Dim oInfoStore As MAPI.InfoStore Dim oField as MAPI.Field Dim lMbxSizeKB as Long ' PR_MESSAGE_SIZE = &HE080003 oField = oInfoStore.Fields(&HE080003) lMbxSizeKB = CLng(oField.Value) / OneKiloByte
This has been discussed before in various forums have a look at the following threads which should offer a solution http://groups.google.com.au/group/microsoft.public.exchange2000.admin/browse_frm/thread/c9a56243ca9fd7a/081e6ae4452c2526?tvc=1&q=PR_MESSAGE_SIZE+size+2gb&hl=en#081e6ae4452c2526 and http://groups.google.com.au/group/microsoft.public.exchange.applications/browse_thread/thread/67ba5fb9c6a33fa1/48da49dea33becee?q=PR_MESSAGE_SIZE+size+2gb&rnum=5&hl=en#48da49dea33becee Cheers Glen "Scott Lemen" wrote in message news:D63347A1-6FD3-4B97-AF1C-6E179CD617F6@microsoft.com... > Hi, > > I have a CDO (VB .Net 2003) program (code segment below) that loops > through mailboxes and collects their sizes. The code works well until it > encounters a mailbox of greater than 2GB. In those cases the > oField.Value, > which is an integer, contains a negative number. I have two questions: > > 1. How are the negative values converted to the actual size? Adding 4GB > to > the value does not result in the value shown in Exchange System Manager > (Exchange 2003 SP1.) Adding 4GB results in a sum that is wrong by > 9,435,055 > bytes. > > 2. What does oField.Value contain when the mailbox is larger than 4GB > since > it is a 32 bit integer and can only contain values between +2147483647 and > -2147483648? > > Thank you, > > Scott Lemen > > This code is right out of KB article 320071 > > Const OneKiloByte = 1024 > Dim oInfoStores As MAPI.InfoStores > Dim oInfoStore As MAPI.InfoStore > Dim oField as MAPI.Field > Dim lMbxSizeKB as Long > > ' PR_MESSAGE_SIZE = &HE080003 > oField = oInfoStore.Fields(&HE080003) > lMbxSizeKB = CLng(oField.Value) / OneKiloByte >
Thank you. But, Microsoft must have a solution to displaying the size of a mailbox greater than 4GB and an unsigned integer will only go to 4GB. I know the executives I support will get there eventually. Thank you, again. Scott "Glen Scales [MVP]" wrote: > This has been discussed before in various forums have a look at the > following threads which should offer a solution > > http://groups.google.com.au/group/microsoft.public.exchange2000.admin/browse_frm/thread/c9a56243ca9fd7a/081e6ae4452c2526?tvc=1&q=PR_MESSAGE_SIZE+size+2gb&hl=en#081e6ae4452c2526 > > and > > http://groups.google.com.au/group/microsoft.public.exchange.applications/browse_thread/thread/67ba5fb9c6a33fa1/48da49dea33becee?q=PR_MESSAGE_SIZE+size+2gb&rnum=5&hl=en#48da49dea33becee > > Cheers > Glen > > > > > "Scott Lemen" wrote in message > news:D63347A1-6FD3-4B97-AF1C-6E179CD617F6@microsoft.com... > > Hi, > > > > I have a CDO (VB .Net 2003) program (code segment below) that loops > > through mailboxes and collects their sizes. The code works well until it > > encounters a mailbox of greater than 2GB. In those cases the > > oField.Value, > > which is an integer, contains a negative number. I have two questions: > > > > 1. How are the negative values converted to the actual size? Adding 4GB > > to > > the value does not result in the value shown in Exchange System Manager > > (Exchange 2003 SP1.) Adding 4GB results in a sum that is wrong by > > 9,435,055 > > bytes. > > > > 2. What does oField.Value contain when the mailbox is larger than 4GB > > since > > it is a 32 bit integer and can only contain values between +2147483647 and > > -2147483648? > > > > Thank you, > > > > Scott Lemen > > > > This code is right out of KB article 320071 > > > > Const OneKiloByte = 1024 > > Dim oInfoStores As MAPI.InfoStores > > Dim oInfoStore As MAPI.InfoStore > > Dim oField as MAPI.Field > > Dim lMbxSizeKB as Long > > > > ' PR_MESSAGE_SIZE = &HE080003 > > oField = oInfoStore.Fields(&HE080003) > > lMbxSizeKB = CLng(oField.Value) / OneKiloByte > > > > >
I would suggest using PR_MESSAGE_SIZE_EXTENDED &He080014 which im lead to believe is a 64 bit Integer (datatype PT_I8) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchserv/html/props1_6l2r.asp which should be able to hold up to 16 terabytes http://support.microsoft.com/default.aspx?scid=kb;en-us;261891 you may also want to read http://msdn.microsoft.com/library/default.asp?url=/library/en-us/olintapi/html/oliaServerFolderSizesProperty_HV01155302.asp Cheers Glen "Scott Lemen" wrote in message news:6E89EF46-00FF-4C2A-BE94-1BC1E8839A3D@microsoft.com... > Thank you. But, Microsoft must have a solution to displaying the size of > a > mailbox greater > than 4GB and an unsigned integer will only go to 4GB. I know the > executives > I support will get there eventually. > > Thank you, again. > > Scott > > "Glen Scales [MVP]" wrote: > >> This has been discussed before in various forums have a look at the >> following threads which should offer a solution >> >> http://groups.google.com.au/group/microsoft.public.exchange2000.admin/browse_frm/thread/c9a56243ca9fd7a/081e6ae4452c2526?tvc=1&q=PR_MESSAGE_SIZE+size+2gb&hl=en#081e6ae4452c2526 >> >> and >> >> http://groups.google.com.au/group/microsoft.public.exchange.applications/browse_thread/thread/67ba5fb9c6a33fa1/48da49dea33becee?q=PR_MESSAGE_SIZE+size+2gb&rnum=5&hl=en#48da49dea33becee >> >> Cheers >> Glen >> >> >> >> >> "Scott Lemen" wrote in message >> news:D63347A1-6FD3-4B97-AF1C-6E179CD617F6@microsoft.com... >> > Hi, >> > >> > I have a CDO (VB .Net 2003) program (code segment below) that loops >> > through mailboxes and collects their sizes. The code works well until >> > it >> > encounters a mailbox of greater than 2GB. In those cases the >> > oField.Value, >> > which is an integer, contains a negative number. I have two questions: >> > >> > 1. How are the negative values converted to the actual size? Adding >> > 4GB >> > to >> > the value does not result in the value shown in Exchange System Manager >> > (Exchange 2003 SP1.) Adding 4GB results in a sum that is wrong by >> > 9,435,055 >> > bytes. >> > >> > 2. What does oField.Value contain when the mailbox is larger than 4GB >> > since >> > it is a 32 bit integer and can only contain values between +2147483647 >> > and >> > -2147483648? >> > >> > Thank you, >> > >> > Scott Lemen >> > >> > This code is right out of KB article 320071 >> > >> > Const OneKiloByte = 1024 >> > Dim oInfoStores As MAPI.InfoStores >> > Dim oInfoStore As MAPI.InfoStore >> > Dim oField as MAPI.Field >> > Dim lMbxSizeKB as Long >> > >> > ' PR_MESSAGE_SIZE = &HE080003 >> > oField = oInfoStore.Fields(&HE080003) >> > lMbxSizeKB = CLng(oField.Value) / OneKiloByte >> > >> >> >>