Posts
47
Comments
55
Trackbacks
0
Announcing the Exchange 2007 PowerShell Scriptacular demo pack!

 

Dear Exchange 2007 Enthusiast(s),

I'd like to announce the Exchange 2007 PowerShell Scriptacular (download zipfile) demo pack. What is it you ask? Well... this collection of Exchange PowerShell scripts was developed by Mihai Jalobeanu and Vivek Sharma while they (we) developed the Exchange Management Shell. We had a lot of fun writing these scripts, and we used them to showcase the innovations in Exchange 2007 System Management--we also promised that when Exchange 2007 is released to the wild, that we'd make our favorite scripts available to everyone. So here they are!

If you want our exact demo setup: to get started, put everything in a directory (d:\scripts or something), and run generate. You need datafiles and you need to customize initvars.ps1. If you don't, the demo pack won't work.

Or you can just take a look at the scripts and learn from the bits and pieces that interest you.

Note: These are Microsoft copyrighted samples, are provided as-is and confer no warranties or rights.

Script Pack Contents: 

  • addfakeservers.ps1 and removefakeservers.ps1

    NOT standalone. Makes it looks like your demo setup has more than one server. We use a very useful feature of Exchange 2007 setup to make this work. Basically we use the /provisionedserver switch to create pre-provisioned servers (AD objects). The admin interface detects these as servers, even though the hardware has not been installed yet. This enables server delegation and pre-provisioning in  Exchange topologies.

  • balancemailboxes.ps1

    Standalone. This script shows how you can use PowerShell to easily load balance mailboxes by size across servers. Key thing is the use of get-mailboxstatistics and move-mailbox.

  • cleanup.ps1 and generate.ps1

    NOT standalone. Cleanup.ps1 completely restores your demo environment to a basic-just-installed-Exchange state. New car smell not included. Generate kicks off everything else to generate the demo environment. 

  • initvars.ps1

    NOT standalone. Standard variables shared by all the scripts. Called by generate.ps1. MAKE SURE TO EDIT THIS FILE to customize this for your environment.

  • mailstorm.ps1 and mailstorm2.ps1

    Standalone with caveats. What's a demo Exchange enviroment without some email? BTW: this is the one script that is likely to not just work automatically in your environment. This is because we assume some basic auth settings to make the Hub server accept mail. This step is done in generate.ps1 so make sure you do that if you plan to use this script by itself.

  • multi-matrix.ps1

    Standalone. Totally totally useless. But cool damnit. This is the matrix unloaded ... er... powershelled.

  • out-email.ps1

    Standalone, with caveats. Just like the name implies, sends content over mail. You can pipe text to it. get-content c:\sometext.txt | out-email -to jimmy@crackcornandidontcare.com -subject "Report". It uses the "from" from initvars.ps1 so make sure to copy those lines as needed to make it standalone.

  • out-html.ps1 and out-ie.ps1

    Standalone. I already posted these to http://www.viveksharma.com/techlog earlier.

The datafiles are politician names, committees, standard drafts of the European Union. We've used US congress / house data in the past too---anything goes, it was publicly available data so it works great for demos.

The scripts (and their latest versions) can always be found at: http://www.viveksharma.com/techlog.

-Mihai Jalobeanu and Vivek Sharma

posted on Thursday, December 21, 2006 6:12 PM Print
Comments
Gravatar
# 
Jea
1/3/2007 2:01 PM
  
I was using System.Management.Automation.dll to call E2K7 cmdlets from c#. I have noticed above dll is not shipped with Powershell RTM adn E2K7 RTM? Is this going to be supported or something else replaced above component.
Tnx
Jea
Gravatar
# 
Yaakov
1/14/2007 7:01 AM
  
IAA
Gravatar
# 
mik
1/15/2007 2:01 AM
  
thank you
Gravatar
# 
Richard Siddaway
2/4/2007 11:02 AM
  
The scripts & whole idea are great.

Couple of slight issues - the members of Netherlands don't get the country set. Needs to be "Netherlands, The" for the script to work. ADU&C accepts Netherlands.

The acount for Baroness NICHOLSON OF WINTERBOURNE from the UK doesn't get created because the name doesn't follow the last and first convention established in the csv file

Other than that everything's worked great - thanks
Gravatar
# 
Steve Sweetman
5/14/2007 12:05 AM
  
thanks
Gravatar
# 
slavko
6/11/2007 7:06 AM
  
super
Gravatar
# 
Sumitr
6/13/2007 12:06 AM
  
Thank you
Gravatar
# 
Raj
8/15/2007 10:08 AM
  
Vivek,

Do you recommend any books for Pwershell scripting?

thanks

Raj
Gravatar
# 
Mik
8/29/2007 5:08 AM
  
Top stuff... Little bit of tweaking needed to get mine to work right, but i now have a great test lab environment.

Just so that you all know, i have a great little script for creating mailboxes for users already in AD for Ex2007. I had 1000 users and wanted to create mailboxes for them all...

get-user –organizationalUnit users | where-object{$_.RecipientType –eq “User”} | Enable-Mailbox –Database “YOURSERVERNAMEHERE\First Storage Group\Mailbox Database” | get-mailbox | select name,windowsemailaddress,database

This querys AD for users in the USERS OU and create mailboxes for them all... Much much easier than having to create them manually... This gave me such a headache so i thought id post here...

Thanks All

Mik
Onsite IT
www.onsite-it.co.uk
Gravatar
# re: Announcing the Exchange 2007 PowerShell Scriptacular demo pack!
Vivek Sharma
1/29/2008 9:27 PM
  
Hi Folks, running into some technical difficulties w/ the blog, so I apologize if your comments got lost or seem to be ignored. I'm working on it... Thanks, ~vivek

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 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!