Page 1 of 1 1
Topic Options
#206715 - 2013-02-18 11:01 AM Get specific Exchange folder size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Hi guys,

I've been looking for this for some time now but did not find anything useful yet.

In our company we have the need to get the size (and number of items in the folder if possible) for a specific sub-folder in all our users’ mailboxes. This folder always has the same name but may not exist in some mailboxes. I tried some VBS scripts, PowerShell and the BoxSize UDF but none of them fit our needs and I lack some of the skills to get them updated to returns what I need.

Is this even possible? And if so can anyone lend a hand?

BTW, for now we are still on Exchange 2K3 on a Win2K3 server but we will upgrade soon.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#206718 - 2013-02-18 04:28 PM Re: Get specific Exchange folder size [Re: Mart]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
I just did a google search and the first two links look promising...
https://www.google.com/search?q=script+e...lient=firefox-a
_________________________
(... better days ahead)

Top
#206721 - 2013-02-18 04:59 PM Re: Get specific Exchange folder size [Re: Allen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Allen,

That is sort of what I need but not exactly. I know how to get the mailbox size and the number of items in the mailbox. The first one is one of the options I tried but unfortunately it did not fit our needs. Maybe it can be modified to make it fit our needs but I do not know how.

Maybe I should be a bit more clear about what is needed.

We have a whole bunch of mailboxes that may have a specific folder as a sub folder of the inbox folder. The name of this folder is the same for everyone (Suspected spam) but if a user never received any spam the folder may not exist because it is created by the spam filter when the first message marked as spam for the specific user arrives. Everyone knows they should go through this folder every now and then and clean it up by deleting the junk and if there are any false positives report them to IT and move the message to the desired folder. Several users refuse or do not understand the concept of cleaning up and use this folder for storage. I would like to be able to get a list of mailboxes and the size of the Spam quarantine folder they have in their Inbox.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#206722 - 2013-02-18 05:15 PM Re: Get specific Exchange folder size [Re: Mart]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Have you tried doing this from the client side, ie Outlook? I can't find it, but I messed with a Outlook script at some point. However, The Scripting Guys have something similar that you could use as a starting point.

http://blogs.technet.com/b/heyscriptingg...ook-folder.aspx
_________________________
(... better days ahead)

Top
#206723 - 2013-02-18 05:56 PM Re: Get specific Exchange folder size [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
and combined with this one... probably get everything you need...
http://blogs.technet.com/b/heyscriptingg...look-inbox.aspx
_________________________
(... better days ahead)

Top
#206724 - 2013-02-18 06:07 PM Re: Get specific Exchange folder size [Re: Allen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Hmmmm....looks interesting. I'll play with it a bit and see how far I can get it up and running. There seems to be PowerShell method too but I keep on seeing that at least Exchange 2K10 is required.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#206804 - 2013-02-26 03:37 PM Re: Get specific Exchange folder size [Re: Mart]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Ok, got something cooking. Could be a bit nicer maybe and may need some tweaking but for now it works. I got two other UDF's cooking at the same time that are sort of related so I'll wait with posting the final versions until all three of them are ready and fully tested.

 Code:
Break On

$FolderID = 6
$Target = "Suspected Spam"

$test = GetSubfolders($FolderID, $target)

? $test[0]
? $test[1]
? $test[2]


Sleep 5
	
Function GetSubfolders($FolderID, $target)
	Dim $MyArray[2]
	$outlook = CreateObject("Outlook.Application")
	$namespace = $outlook.GetNamespace("MAPI")
	$folder = $namespace.GetDefaultFolder($folderID)
	
	$colFolders = $Folder.Folders
	For Each $objFolder in $colFolders
		$objSubfolder = $Folder.Folders($objFolder.Name)
		If $objSubfolder = $target
			$MyArray[0] = $objFolder.Name
			$colItems = $objFolder.Items
			$MyArray[1] = $colItems.Count
			For Each $objItem in $objFolder.Items
				$intSize = CInt($intSize) + $objItem.Size
			Next
			$MyArray[2] = CInt($intSize) /1024
		EndIf
	Next
				
	$GetSubfolders = $MyArray
EndFunction
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#206811 - 2013-02-26 09:39 PM Re: Get specific Exchange folder size [Re: Mart]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
See: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=206810#Post206810
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2795 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.056 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org