Skip to main content


Showing posts from January, 2007

Exporting a Mailbox larger then 2 GB and spanning it across multiple PST files with a script

*update* I suggest checking out Michael Smith's RDO port of this script which is a much more developed examples . *update* I have a small customer with an old server that recently had a staff member leave who had a very large mailbox over 5 GB. Now these guys are pretty tight still using Exchange 2000 and Office 2000 and don’t want to upgrade software or hardware so getting rid of this mailbox out the Exchange store while still giving people occasionally access to this mailbox was desirable and also challenging. Because all the clients are using Outlook 2000 I’m stuck with the 2 GB PST non-Unicode file limit which Exmerge is similarly afflicted with. Using Exmerge with date filters was one possible solution but I decided I’d rather just do a liner export where mail was exported one item at a time and would just span to the next PST when the space was ex

Sending Attachments via the Exchange Web Services in Exchange 2007

Anyone who has every tried to send an attachment using WebDAV will know that it is a real pain compared with CDOSYS/CDOEX where it was generally just one line of code. The new Exchange Web Services fall somewhere in the middle of these two while not a simple 1 line of code the functionality is there it is just not immediately easy to work out how to do it. Here are two methods I’ve found that work if you want to send a message with an attachment (or just create an item or attach something to an already existing item). Note there are probably some other methods you can use but hopefully this is a little more helpful then just the XML in the current SDK. The first method is to create an item in a folder (eg the drafts folder) using a createitem operation then using the itemid and changeid returned from the create item request use the createattachment operation to attach the file to the new item you created. Then using the new changeid returned after the createattachment operation use a s

Audit and Export all emails in an Exchange Store Sent and Received to and from a certain domain

This is one that came up for me this week where for audit purposes all communication between a certain email domain needed to be found and exported in a Exchange Store. I all ready had the bones for this script in one of my other posts all I needed to do was adapt this by adding in some code to retrieve the fromemail and the to properties and then do a substring search of both of these properties. If a match is found the email is then exported by using WebDAV to get the stream of the item and then using an ADO stream to write the stream to a normal EML file that can then be opened in any mail client. The script works using WebDAV and it connects to and scans every mailbox using the Admin virtual root which means the script can run with delegated Exchange admin rights. The first part of the script contains some ADSI queries to work out what the URL to the admin root is and then calls the RecurseFolder sub this sub is based on the code from the mailbox size KB . With a few exceptions t

Exchange 2007 diagnostic logging Powershell quick set winform script

One of the things that has been dropped from the GUI (Exchange Management Console) in Exchange 2007 is the ability to set the diagnostic level of different Exchange components. You now have to use the Exchange Management Shell cmdlets get-eventloglevel and set-eventloglevel. While functional if you have to enable a number of different categories if you are trying to diagnose certain problems it can be a little cumbersome to try and come up with a different command-line for each one of the possible 150 components you might want to change. Because I do tend to enable and disable these things a fair bit when trying to fix a problems or diagnose why a piece a code or script might not be working I thought I’d come up with a little Powershell winform that would give me a GUI to do this with and allow me to quickly set the diagnostic logging level on a number of components with a few clicks of the mouse. The script first starts by presenting a Winform to the user with one combo box which is
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.