Skip to main content


Showing posts from September, 2005

Reporting on Disconnected mailboxes and showing when they will be purged in Exchange 2003

One of cool things you can do in Exchange 2003 using the Exchange_Mailbox WMI class in you can show all the disconnected mailboxes by querying the DateDiscoveredAbsentInDS property which gets set after the “Cleanup Agent” has detected that there is no longer a Active Directory account associated with this mailbox. To make this information really useful in a report you need to combine it with what the Mailbox retention settings are on the mail-store where this mailbox is located. This will tell you when the mailbox is going to be deleted and how many days it has left in the cache. This information may be interesting if you have a mailbox that is quite large and you want to know when that space will be recovered into the mail-store. It can also come in handy if you need to monitor your helpdesk staff to make sure they aren’t deleting any mailboxes they shouldn’t. eg you could use it to email a warning when there is only 2-3 days left before a mailbox will be permanently deleted to reall

Showing status of all SMTP Virtual Servers in your domain

The status of your SMTP virtual servers eg whether the server is Started, Stopped, Paused is held in the IIS Metabase on your Exchange server in the ServerState property. If you wanted to query this value from a script there is a ADSI provider for IIS which allows you to connect to the Metabase and retrieve this value much like you can with Active Directory. Armed with this information you can now create a script that first queries Active Directory for all the Virtual Server objects within a domain. Then using the properties on these Virtual server object you can determine the servername of each server where the VS exists and then connect to the Metabase on that server and retrieve the Serverstate property. So you end up with a simple script that will give you a status of all the SMTP virtual servers in you AD domain. This script looks like the following I’ve put a downloadable copy here set conn = createobject("ADODB.Connection") set com = createobject("ADODB.Command&q

Importing Vcards from vcf files to Outlook Contacts and Vcard conversion Event sink

Over the past week I’ve been working on some code to convert vcards from the Palm Desktop software into Contacts that can be stored in either the Outlook Contacts folder or a Public Contacts folder. You can read more about the vcard format at . Vcards are great for exchanging information and you’ll find them in use on everything from Mobiles to I believe some Ipods now support vcards. I’ve come up with a couple of versions of this script the first script will take a directory that contains Vcards and create a new contact for each vcard file in the directory. The other thing I’ve created is a Event sink so you can send a mail that has an attached vcard the sink will detach the vcard and create a contact within that folder from the information that’s contained in the Vcard. As I was mainly working with the Palm Desktop software this software also allowed the inclusion of a photo within the Vcard so this script also handles converting this photo into a Jpg and at

Add a Picture to Contact in Outlook 2003 via Script

I'm currently writing some code for an event sink that will convert a Vcard attached to a message into a contact in a public folder. Mostly the Vcards that I want to import are from the Palm desktop software which allows you to add images into the contact similar to the new functionality added to Outlook 2003. So as part of my code I had to come up with something that would decode the picture from the vcard file and then add it to the contact in a way Outlook 2003 would understand it. Although I haven't quite finish the vcard code i thought this was worth a separate post. Basically to add a picture to a contact in Outlook you need to first have the file in jpg format and the name of the file your going to attachment must be ContactPicture.jpg. Once you have attached that file you then need to modify/Add 2 properties on that attachment itself. The only API that you can use to successfully do this (well that I've found) is MAPI. So this means you need to use CDO 1.2 if your s

Creating a new folder in a mailbox if one doesn't exist in WebDav

I posted a script that did this using ADO/Exoledb some time ago here someone asked this week about doing the same thing using WebDAV. In WebDAV to create a folder you use the MKCOL verb eg but if you try and issue this against a URL that already exist then it will throw a 405 error. While dealing with such an error is not that difficult an alternative to doing this is to first do a search against the parent folder to see if that folder exists and then take the appropriate action. A script to do this looks like the following I've posted a downloadable copy here . The script itself looks for a folder called Spamfolder within the inbox if it doesn't find it then it creates it using MKCOL. server = "Servername" mailbox = "Mailbox" NewFLd = "Spamfolder" strURL = "http://" & server & "/exchange/" & mailbox & "/inbox/" strQuery = " " strQuery = strQuery & " SELECT ""http://schema

OT: Back online

Just a quick post to say im back online after a good holiday im still trying to catch up on everything. This is one of the more amusing signs that I came across while on holidays.
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.