Posts
47
Comments
55
Trackbacks
0
How to 2007: Setting the Journal Recipient in Exchange 2007

Whenever I do a webcast or presentation, I try to use examples which are immediately useable. Sometimes its tough to get a pulse on what are the frequent things that people do with Exchange, so I've been looking at what the community has written scripts for in 2003 and converting them to the equivalent in 2007. I hope that a) this will provide a "bootstrap" so you have some snippets to use immediately and b) that this will show you that cmdline/scripting in 2007 is much easier (you don't have to be afraid to learn about it or use it). Here's a good example to kick this effort off: Glen put an excellent script solution to setting the journal recipient in Exchange 2003. As you can see, CDOEXM lets you do it, but its a little complex. Here is the equivalent in Exchange 2007:

set-MailboxDatabase servername\mdbname -JournalRecipient domain\username

And no I'm not lying, that's really what it is. Is the above statement a "script"? Technically yes, but its so much simpler! Not only that, its much more powerful. Let's say you want to set the journal recipient on ALL your mailbox databases:

get-MailboxDatabase | set-MailboxDatabase -JournalRecipient domain\username

How about setting the journal recipient on all mailbox databases on a particular server?

get-MailboxDatabase -server MyServer | set-MailboxDatabase -JournalRecipient domain\username

And if you get a little nervous with this new fangled tool (sometimes I do too!), you can check what a command is going to do before actually running the command (whoa) by running whatif:

set-MailboxDatabase servername\mdbname -JournalRecipient domain\username -whatif

So don't be scared by the cmdline. Its easy once you learn a few basic concepts (verb-noun naming convention, how to pipeline and how to pass parameters) and is likely to save you lots of time and effort. Finally, let's compare the # of lines it took to do this in CDOEXM vs. PowerShell/Monad (using the first example given above):

CDOEXM:

Lines      : 43
Words      : 173
Characters : 1643

PowerShell/Monad:

Lines      : 1
Words      : 4
Characters : 72
 

posted on Saturday, May 20, 2006 5:05 AM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 8 and 4 and type the answer here:
News
A little slow these days as I'm busy working on exchangelabs.com. I will try and post tidbits when I get some time. Enjoy the older posts till then!