Skip to main content

Posts

Showing posts from May, 2006

Power-Shelling the Message Tracking logs on Exchange 2000/2003

If you’ve ever had to write any scripts that query the message tracking logs though WMI you may have come across the issue that WQL cant handle doing a Where clause on an array. Because the Recipient address’s on an email are returned as an array when you want to use this class to make a query that only shows mail that is going to one address it can be a little cumbersome. With Powershell although you are still stuck not being able to filter via recipient address in a WMI query what you can do now is pipe that result to the where-object cmdlet where you can then filter the result to one particular recipient address. If you combine this in a script what you can then do is query the tracking logs for the past x number of hours to show any email sent to a particular recipient. The reverse is also true you can query to see all the email sent from a particular address. What I’ve done is put two scripts together that do this both scripts take 3 input parameters the first is the name of the s

Company Instant Message RSS feed Notice Board LCS response Bot using communicator Web Access (Ajax)

Company announcement notice boards are something I’ve done a bit in the past usually these are web based the last one I did a while ago used a simple Exchange Event sink to create a simple web based notice board where information about company events could be posted to a mailbox and appear on the web page. They are also useful for posting things like network outages or as a change control list. With new technology comes new ways of doing things and seeing how I had the code for creating a LCS bot and a RSS feed it seemed natural to join them together and basically have a LCS bot that creates and RSS feed based on Instant message you send to it. The bot part of this code work’s as per my pervious post the RSS feed part creates a simple RSS document using the MICROSOFT.XMLDOM object. Because you can’t specify a subject and body in IM there’s some code that looks for any carriage returns in the Instant message and if it finds a carriage return it takes the first section as the title for

Change the Journal Recipient for an Exchange Store with CDOEXM via a Script

I’ve been asked the above question a few times by different people and although there is nothing in the Exchange SDK about this someone pointed me to an the following KB article that shows how to do this in C++. This being a little unfriendly for us mere mortals I put the following script together to hopefully make things a little easier. To reduce the need to go in to ADSI edit and get the DN name of the store object and the user object you want to switch journaling to I put some ADSI queries that will find the store in Active directory based on the stores friendly name (display name in ESM) and the another query that will find the user based on there logon name (samaccountname). The script to change the journal recipient is pretty basic it uses the iMailboxStoreDB interface to change the msExchMessageJournalRecipient Active directory property via the field’s property. Although you could probably do this directly via ADSI it’s probably advisable to stick to CDOEXM. The one thing to n

Finding and Removing Empty Distribution Lists/Groups via a script

Somebody asked about this one last week while there are some valid reasons for having empty distribution lists usually they are things that can stick around because no-one's quite sure if they should be deleted. Writing a script to find and delete empty distribution lists is not too hard although I have put a bunch of safeguards in this script to stop you deleting any groups that you may not want to. Note this script doesn’t differentiate between a distribution group and a security group it just looks for any groups that are mail enabled that have no members. The script first does a search of AD for all mail enabled groups in active directory. It then connects to each group and starts going though its members. If there are more the 10 users in the group it stops counting. This wasn’t really a script to document the members in groups as this can get quite complicated when you consider nesting groups. If you’re after such a script Richard Muller has already written a great script to
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.