I need to create lots of email aliases (more than I want to do manually), so I want to know if there's a way I can script the addition of aliases to existing mailboxes/users. I don't mind if I have to use powershell or an external tool or not.

For each existing user, I need to create a number of new email aliases.

I have, as an example:

Bernhard.Hofmann@domain.com

I then want to create:

Bernhard.Hofmann1@domain.com
Bernhard.Hofmann2@domain.com
Bernhard.Hofmann3@domain.com
Bernhard.Hofmann4@domain.com
Bernhard.Hofmann5@domain.com
...

Thanks

link|improve this question
feedback

2 Answers

When you say "alias" do you mean email address (because in Exchange parlance an alias and an email address are two different things)? If so, why not just add the email address to your Recipient Policy?

EDIT

If you want to add the new email address to all users then add the email address to your existing default Recipient Policy. If you want to add the email address to a subset of users then you'll need to create a new Recipient Policy using a filter that is applicable to this subset of users (an LDAP filter based on some attribute of these users, such as department or office for example).

http://support.microsoft.com/kb/319201

link|improve this answer
Thanks Joe, I did not know that and I've clarified the question. Yes, I want to add email aliases to an existing mailbox/email/person. – Bernhard Hofmann Sep 21 '11 at 12:52
See my edit.... – joeqwerty Sep 21 '11 at 13:08
1  
Good start, but the user's question is about scripting. – jgoldschrafe Sep 21 '11 at 13:17
1  
No, it's about creating/applying an email address to a large number of users to which the OP asked if there was a way to do it via scripting. Should I not have answered because my method doesn't use scripting (but is an appropriate method because you can't just add an email address to a user account, your Exchange server must be configured to be authoratative for the email address, which is accomplished by adding the email address to the Recipient Policy)? Just because my answer doen't involve scripting doesn't invalidate it as a correct and appropriate answer. – joeqwerty Sep 21 '11 at 13:30
My fault Joe, for not making my question clearer. I've edited the question to make it clear that each person needs a number of new aliases. – Bernhard Hofmann Sep 21 '11 at 16:21
show 3 more comments
feedback

A few lines of powershell will do this for you:

$aliasname = Get-Mailbox -OrganizationalUnit "OUName" -ResultSize Unlimited $aliasname | Foreach-Object{ $_ | Set-mailbox -Alias }

This gets a list of all mailboxes in an OU called "OU Name" (you can change the filter to suit your needs) and then sets an alias on each these mailboxes. Obviously you can use the mailbox object to get the name, UPN etc to use as part of your alias if you wish.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.