Exchange Management Shell - search for matching email address, then randomize address if match found
Ineed toautomate mailbox creation on Exchange 2007 through PowerShell. Does anbody have ideas on how to do the following?1) After taking input from a CSV, create a primaryemail address (ex john.doe@domain)2) Then search through existing recipients for a matching email. If there is a match, append a random 3 digit number to the end (ex john.doe486@domain). I guess that another search would need to be done to ensure this address doesn't exist as well, and continue until no match is found.3) Then, if possible, randomize the mailbox database that it is created on. This is just to evenly spread creation of accounts across all servers and it may not work/be a horrible idea/etc, but I would love to hear ideas on it as well. I know how to handle the CSV, and I found some code that will generate the random number, but that is it. Thanks - Bill
April 16th, 2009 12:09am

For mailbox creatig I guess you are using New-Mailbox cmdlet which doesn't have any option to set email address while creation and it will be generated based on Email Address Policies in which user fall under. EAP does the similar job automatically what you are looking for, if no email address found then set it otherwise add numbers at the end and create email address.Amit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2009 7:34am

Thanks for the reply. Thats right, when I tested using New-Mailbox it used EAP and it did see the existing email address, and created a similar one, but itappended alphanumeric characters to the end, such as e86e2. If it helps at all, the format of the addresses are firstname.lastnameDDD, with DDD being the random digits. Is it possible to adjust the EAP so it only adds3 numeric digits?
April 16th, 2009 4:30pm

AFAIK, it is not possible to set certain format to be appended by EAP.Amit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
April 17th, 2009 5:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics