Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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

share|improve this answer
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
    
@Bernhard - I'm not sure that you're convinced, but this is the way to go. Pay special attention to the bits about "replacement strings". These are what allow you to customize the front-end of the e-mail address (rather than just the domain suffixes). support.microsoft.com/kb/822447 –  pk. Sep 21 '11 at 16:35
    
@Bernard: Gotcha. Thanks for the clarification. –  joeqwerty Sep 21 '11 at 17:33

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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