Tuesday, June 17, 2014

Creating new address lists in Exchange for non-employees

So the company I work for has a rather unique AD structure.  For whatever reason we do not use the default containers Users, or Computers.  Someone years before me thought that was too insensitive or whatever.. we have People and Machines.  Funny no?
But we also have containers or OU's for Vendors, Customers, Reps, Dealers, ASAs and Distributors.  Now I'm seeing all these user objects.. because they access an externally hosted website that uses AD authentication, and wonder why there are not address lists for these so Customer Service or Sales can contact them a little easier.

So here we go.. Mail-Enabling in bulk.  I've exported all those OU's out to a tab-delimited CSV, re-arranged the columns to include only Name and ExternalAddress.

get-User -OrganizationalUnit 'domain.com/people/customers' | Export-CSV c:\users\bhart\customers.csv

import-csv "c:\users\bhart\customers.csv" |  foreach-object {Enable-MailUser -identity $_.Name -ExternalEmailAddress $_.ExternalAddress}

And BOOM 

The 100+ user objects are now mail enabled.. well except for the few objects without an ExternalEmailAddress variable, but you get the idea.

Now I just need to go through this process on the remaining 4 other OU's.

No comments:

Post a Comment