Friday, September 3, 2010

Bulk Contact Creation in Exchange With PowerShell and CSV Files

I recently ran into a situation where someone wanted to have Distribution Lists in Exchange that were populated with email addresses of people outside our company. Of course, this meant that each recipient needed its own Contact object in Active Directory. But how to create the dozens of AD objects I'd need to fulfill this simple request?

Luckily, there's a cmdlet for that. Create a CSV file where the first line reads as follows:

Name,ExternalEmailAddress,OrganizationalUnit



Subsequent lines should look like this:

John Doe,SMTP:johnny@example.com,contoso.info/In/This/OU
Jane Doe,SMTP:janey@example.com,contoso.info/In/That/OU



The finished product should look like this:

Name,ExternalEmailAddress,OrganizationalUnit
John Doe,SMTP:johnny@example.com,contoso.info/In/This/OU
Jane Doe,SMTP:janey@example.com,contoso.info/In/That/OU



(Of course, add as many entries as you like)

Got that in a CSV file? Good. Save it somewhere and fire up PowerShell on your Exchange server. Then, run the following:

import-csv Book1.csv | foreach {New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -OrganizationalUnit $_.OrganizationalUnit -whatif}



Edit the file name as needed. I threw in the "-whatif" part so that you can see exactly what the command will do before actually doing it. As long as you like the results, you can take out the "-whatif" to go ahead and create the objects.

Monday, August 30, 2010

WMware ESX, Snapshots and VMware Tools Installation

Want to know a quick way to break a VM?

http://communities.vmware.com/message/472953

First, setup a VM. Then, begin an installation of the VMware Tools. Before finishing, create a snapshot of the VM.

Boom-presto! Your VM is turned off and marked "invalid"!

I might post a follow up if I confirm a solution to be had.

Tuesday, August 17, 2010

SMTP Error 550, 5.1.1 for New Contractor

Yesterday, I had a situation where a user was getting an NDR bounce-back after sending mail to a Distribution List in Exchange. Specifically, one person was listed in the error message: a contractor who had started last week.

To make a long story short, I had created a User object for this contractor so that they could get access to network resources but because he was a contractor, I did not create an Exchange mailbox for him. Instead, I created a Contact object pointing to his personal email address... with this Contact object having the same First and Last name as the User object.

When I added him to the corresponding Distribution List, I of course managed to add the email-deprived User object instead of the Contact object. Hey, the First Name and Last Name matched!

Needless to say, the error that popped up was:

#550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found ##

After removing the User object from the Distribution List and then adding the Contact object, all was well.

Wednesday, April 14, 2010

Setting Up Dimensions in an RDP Window

I have a vertical monitor. It's handy because I can essentially use the top half as one area and the bottom half for another (if I'm not using the whole thing as a fantastic reading pane). This especially comes in handy when I want to have two RDP windows fit perfectly, one on top of the other, on a single window.

To ensure that every RDP window you start automatically fits into the perfect dimensions that you want:

  1. - Edit Default.rdp in a text editor. It should be a hidden file in your My Documents.
  2. - Change XYZ in “desktopwidth:i:XYZ” to exactly the width you want, minus 8 pixels (each window border is 4 pixels).
  3. - Change XYZ in “desktopheight:i:XYZ” to exactly the height you want, minus 34 pixels (bottom window border of 4 pixels plus 30 pixels for the titlebar).
  4. - Save Default.rdp and set it to Read Only so that Windows doesn’t helpfully change the dims on your RDP session to something more standard.

These instructions assume the Luna theme with the standard font size in Windows XP.

Thursday, February 18, 2010

Simple Exchange 2007 Deployment Documentation (TechNet)

For anyone out there ready to deploy a simple- yes,*simple*- Exchange 2007 environment, TechNet provides this article:

http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=b7bad09f-6952-4e54-b482-9fcd30d6c245&displayLang=en

Apparently, "simple" deployments can be documented in no fewer than 479 pages :-)