Add ManagedBy settings in Powershell

I just created 300 new distribution lists on our mixed Exchange environment. These new DLs, all needed a manager assigned to them.

The script below requires/uses cmdlets from the Microsoft Exchange 2007 Shell. For one that doesn't need them, check out Brandon's blog.

Add a row to an existing CSV

I am working on a script to capture key bits of server information from a large list of servers. With each server, I'd like to graph trending data from each server (drive usage, memory usage, etc.). With this I need a place to store the data after each run of the script, opting for storing the output into a CSV file (especially considering the ease of use of the Import/export csv functions in powerhsell).

Query Size and Free Space of Windows Volume Mount Points

I have been tasked with writting a script to analyze our servers on a daily basis. I found this most excellent server inventory script that pulls virtually every conceivable value from a server.

Now, on our Exchange cluster, we've used Volume Mount Points for the resources. This means that a 9gb drive with eight 330gb folders (or mount points) to SAN storage. If I simply pull the drive freespace, I get ~6gb (local hard drive), even though the mount points each show over 100gb free.

Convert and configure Exchange 2007 conference room mailbox

Having recently migrated all of our department to Exchange 2007, we were excited to take advantage of the new conference room functionality! No more Outlook Resource configuration, no more faulty Auto-Accept script! Microsoft has FINALLY programmed in full-fledged resource mailbox functionality into Exchange.

Powershell Quick report - all smtp email addresses

Attending a class this week for Exchange 2007. The question came up to export all SMTP email addresses for all mailboxes. In the lab environment, I worked up this script.

$data = get-mailbox | %{ $dname = $_.displayname;$em=$_.emailaddresses -replace("smtp:",",");$dname+$em}

I have not tested this in a production environment, so I am not sure what will display for users with other than SMTP email addresses.

iPodder/Juice Script Cleanup ID3 tags

As you may already know, I use my MP3 player simply to play audio-books (aka podcasts) while commuting to work.

I use Juice (fka iPodder) to capture these files. It does an excellent job of downloading content and placing it on my machine. Once downloaded, I drag and drop the files to my MP3 player.

La-Z-Boy, Where's my Shearer?

Update - Sept 22, 2008:
Still shaving my furniture after 2 years of use, I decided to file an official complaint with LA-Z-Boy furniture.

I am disappointed with the performance of my sofa and love seat. For years, my wife and I had been looking into furniture for our home. In 2006, we had finally decided on a sofa, love seat and ottoman. We worked for over an hour to pick out material we loved, and the Sales Associate swore that was kid friendly, easy maintenance and good for a family with pets. 3 months later (July 2006) our furniture arrives and all looks good.

Create mailboxes from a CSV file

Takes a CSV file, reads headers and creates mailbox based on values.
Requires two columns in CSV, UserPrincipalname and Name. The UPN can be the SAMAccount value renamed. It will append the variable $UPNDomain to end.

Also requires both Quest ActiveRoles PowerShell tools (to create AD Account) and Exchange 2007 Management tools to set mailbox quota limits.

Find All Mailboxes with Mixed up Quota settings

Invariably, when you let your local admins create mailboxes using a web interface, you will get some odd settings.

One of things that I've noticed, when running PowerShelll queries, is all the mailboxes with incorrect quota settings. Users with Send Receive limits lower than the Notification settings. Tired of these alerts, I created the following to dump those mailboxes to a CSV.

Find ALL DLs that a specific person manages

Friend is working on the dirty deed of removing a series of accounts from AD. As part of that clean-up he is to find all the distribution lists that each account is assigned manager on. Using the Quest ActiveRoles Powershell tools, you can quickly find these unfortunate people using:

$selectUser = Get-QADUser "John Doe"
Get-QADGroup -SizeLimit 0  -ldapFilter '(&(mail=*)(managedby=*))' | where {$_.managedby -eq $selectUser}  | select displayname, managedby