Add a custom email alias to all my mail enabled users

Hey Everyone,
I'm trying to add an email alias to all my mail enabled users using powershell.
 I'm in a dir sync setup can I do something like the below.Of course the smtp:$($a.lname)_$($[email protected] isn't working for me. It was posted online as "$a.alias", which isn't what I need. I need
to add [email protected] to every mailbox.A crappy voice mail system software that can't alter it's send To address format template is driving this change.  I don't want to use an address policy, due to it
changing the default reply in the process.
if someone can help me get this script working that would be fantastic.
$users = Get-Mailuser
foreach ($a in $users) {$a.emailaddresses.Add("smtp:$($a.lname)_$($[email protected]")}
$users | %{Set-Mailuser $_.Identity -EmailAddresses $_.EmailAddresses}
Suleman

I don't have an Exchange environment to test this. I just fxed up the syntax. Does this work:
$users = Get-Mailuser
foreach ($user in $users) {
$user.emailaddresses.Add("smtp:$($user.lname)_$($user.fname)@domain.ca")
$users | % { Set-Mailuser $_.Identity -EmailAddresses $_.EmailAddresses }
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

Similar Messages

  • How to add Distribution Group email alias from CSV in office 365

    Hello Forum!
    Hope someone can help me troubleshoot this or even let me know if its not possible. But, I used powershell to import distribution groups and set primary emails in Office 365. That worked great, but we have two domains and i would like to add an email alias
    to all my DGs for the other domain.
    This was my best attempt and its not going well:
    Import-CSV "C:\distributionlists.csv" | foreach {Set-DistributionGroup "$_.Name" -EmailAddresses SMTP:$_.PrimarySmtpAddress,$SecondarySmtpAddress}
    $_.Name is the column name for my DGs. IE: DL-IT
    $_.PrimarySmtpAddress is the column name for my primary email. IE: [email protected]
    $_.SecondarySmtpAddress is the column name for my email alias. IE: [email protected]

    Hi,
    Based on my understanding, the below code should work when your manually run it:
    Set-DistributionGroup "DL-accounting"
    -EmailAddresses SMTP:<Primary Email>,<Alias Email>
    If all those distribution groups have been already created, then use set-distributiongroup command should work. How about first new those distribution group, and then run foreach block to do the loop.
    Regards,
    Yan Li
    Cataleya Li
    TechNet Community Support

  • How can I add an iCloud email alias?, How can I add an iCloud email alias?

    I'm trying to figure out how to add an iCloud email alias but can't figure out where or how to. Please help.

    You do it on the iCloud website at http://www.icloud.com , in the Mail section. Please see this Help page:
    http://help.apple.com/icloud/#mm6b1a490a

  • EXCH 2007: All email addresses forwarded to a mail-enabled Public Folder

    I need to find all mailboxes and their aliaes that are setup to be Forwarded to a mail-enabled public folder.  Is there an Exchange Mangement Shell script that I can run that will produce that list for me?  Or some other way of finding those mailboxes/aliases? 
    Thanks
    Matt

    Hi Matt,
    We can try the following command (proposing that Winnie is the Mail-enabled public folder):
    Get-Mailbox | Where-Object { $_.ForwardingAddress -eq “Domain.com/Microsoft Exchange System Objects/Winnie” } | Select Name, ForwardingAddress, DeliverToMailboxAndForward
    Hope it works.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • Auto Population of Email Definition fields while sending mails to user

    Hi,
    I have the requirement that after a resource object has been provisioned to an user, a mail should be sent to him for confirmation.
    I am able to successfully send mails to users after the resource object has been provisioned to him by making the configuation settings in the OIM system.
    I have made use of a Resource Object , Resource Form , IT resource of type mail server , Email definition etc.
    The point is while provisioning the resource object I am populating the User Defined Fields. These fields are visible at the xlWebApp console through the resource form. I am populating these fields while requesting the resource through the xlWebAPp UI.
    Now i need to send mails to the user with these fields populated with the values that i m providing while provisioning the resource. Currently my sent mails just consist of plain email definition with a subject line and a body text.
    Please let me know how can i include the values in the populated fields in the body of the mail through settings in OIM.
    Since i m a QA person i cannot go ahead and write code for creating an adpater for this task. Kindly let me know is there any way by which I can do the same through config settings in OIM.
    Thanks in advance.
    Pooja.

    Hello,
    Actually i have a resource object as "Laptop" suppose, so for me the user defined fields are Laptop_type, RAM value, ROM Value and Emp ID.
    These fields are made visible as UDF through Pre-pop adapters and all the other required settings.
    While provisioning the same in the xlWebApp console I am populating them.
    The resource form for me (Form Designer for the resource object) is made visible and i am filling in values while provisioning.
    Now while sending the mails these values should reflected in the mail body for the fields.
    Eg: Subject [hi] Mail body [ The following resource has been provisioned. Laptop_type : Dell, RAM value: 512, ROM value: 40, EMP ID: 123] where these values are filled in the resource form while provisioning the resource object.
    Pleased let me know how can i send such mails through config settings in OIM. Right now my mail simply looks like
    Eg: Subject [hi] Mail Body [The resource has been provisioned to you]
    Thanks again.
    Pooja.

  • Where do i add a new email alias?

    I can no longer find where i set up a new alias email address for my iCloud account.
    I have found "alternate" email addresses but this doesn't accept anything i try to add as an alias so I'm guessing its not that..
    This USED to be easy..
    Any ideas?
    Ta

    It's the same as it always was. Go to http://www.icloud.com and go to the Mail page. Click the cogwheel icon at bottom left and choose 'Preferences'. IN the tab which opens click 'Accounts' in the toolbar.
    You will see a column on the left showing your account with any aliases you have below it. You can only have up to 3 aliases. As long as you have fewer, you can click on the '+' sign below the list and add an alias.
    If you have three (or more if you migrated from MobileMe with its five aliases) you will have to delete one or more to bring it down to two, and then wait a weej before you can add a new alias. Aliases can only be @icloud.com - @me.com addresses can no longer be created (though existing ones will continue to work).

  • How to remove own email when replying all in mail

    When I hit Reply All in the Mail app, it automatically puts my own email in CC. How can I stop this?

    paulcb wrote:
    As expected, when I "Reply All" to emails sent to me, I'm not included in the CC.  I assume this is the scenario that the OP is referencing, except that he's included in the CC.  Perhaps he can explain in more detail.
    When I reply all, I AM included, but it disappears if I tap the CC/BCC field.

  • Would like to automate this Powershell command that sets the UPN of all mail enabled users

    I have command that changes the UPN of all mailbox users
    Get-ADUser -Filter * -properties homemdb | where {$_.homemdb -ne $null} | ForEach-Object ($_.SamAccountName) {$CompleteUPN = $_.SamAccountName + “@contoso.com”; Set-ADUser -Identity $_.DistinguishedName -UserPrincipalName $CompleteUPN}
    The command works using the AD module for
    powershell. What I would like to do it write a script that does the following.
    Runs the command above
    Only applies changes to users that need it. (I think this applies the setting to all users with the "homemdb")
    I was thinking of setting it as a scheduled task on one of the Domain Controllers. My
    powershell skills are lacking at best, so any guidance on how to set this up would be much appreciated. 
    Thanks

    Cannot bind parameter 'Filter' to the target.
    Exception setting "Filter":
    "Invalid filter syntax. For a description of
    the filter parameter syntax see the command help.
    "(RecipientType -eq
    'UserMailbox') -and
    (UserPrincipalName -notlike
    ('*@{1}' -f $UPNSuffix))" at position 68."
        + CategoryInfo         
    : WriteError:
    (:) [Get-User],
    ParameterBindingException
        + FullyQualifiedErrorId
    : ParameterBindingFailed,Microsoft.Exchange.Management.RecipientTasks.GetUser
    Read the error very carefully: "Invalid filter syntax"
    You filter: "(RecipientType -eq
    'UserMailbox') -and
    (UserPrincipalName -notlike
    ('*@{1}' -f $UPNSuffix))"
    This is not a good filter for anything.
    This is not legal in a filter: (UserPrincipalName
    -notlike ('*@{1}'
    -f $UPNSuffix))"
    See filter syntax for rules on the limited support for PowerShell syntax.   filters are a subset.
    ¯\_(ツ)_/¯

  • Exch 2013 SP1 Mutidomain set up. mail enabled user shows Forest Root Domain email address.

    Hi,
    First let me explain my Exch 2013 SP1 Multidomain set up.
    1. DA as Forest Root domain, having schema master domain role installed.
    DB as Tree Root domain in above forest 
    DC as Child domain in Tree root domain.
    2. After set up, I ran 'netdom query fsmo' on each DC. It displayed schema master role on forest DC and domain role on individual DC on which command was run.
    3. Now to install Exch 2013 SP1, ran appropriate command on forest  DC (i.e PrepareAD, Prepareschema and alldomain).
    4. Brought 1 machine in Child domain and installed Exch 2013 SP1 server on it.
    Now, when I access ECP, Create user, new mailboxdatabse etc. options available only if login to ECP by ForestRootDomain\administrator credentials. please confirm.
    while creating new user, it shows User Login Name with Child.TreeRootDomain.local default but after creating user, it shows [email protected] as Email address. Please confirm.
    Thanks and regards,
    Sudhir

    Logged on Exch machine by child\administrator user credentials.
    Unabel to get Set-ADServerSettings -ViewEntireForest $true command in exchange powershell.
    can get only Set-AdServeiceAccount command.
    Also if poosible, please confirm, weather multidomain set up is correct?

  • Cannot add 3rd Email alias

    Hi,
    I tried to add a 3rd email alias to my icloud account. Everytime I get an error that I have to wait 7 days to add a new one. I moved my .me account with 2 Aliases on the icloud release day and after that I dont add or delete an alias. The move is over 7 days ago, so why I can't add a 3rd Email Alias?
    Thanks
    Alex

    Had exactly this problem for about 4 months. Some folk have been able to do it, some still can't. I finally had some movement in a way. It refreshed and said I had a full amount of aliases again. Which was a bonus cause I didn't think I had one of them.
    Now I deleted another one to make room again, and it keeps coming back each day. Hurrah! Or not. This has been buggy and not working properly for ages and still no solution or response on how to make it do what it is supposed to. I'd have rather stayed with me.com and paid yearly for it to work rather than not pay and it not work properly.

  • HT5361 How can I add a second email address to my existing email account.  I can't find out how to accomplish that.

    I have an exisitng email address but I need to create a more professional sounding email address for work.  I can't figure out how to do this.  I'm using OS X 10.8.4
    Thanks!

    If you mean you want to add a second email address to the Mac Mail app:
    Open Mail > Preferences > Accounts > Click the plus sign and enter the information
    If you mean you want to add an alias to your iCloud mail account:
    Go to https://www.icloud.com > sign in > Mail > Click the Gear on top right > Preferences > Accounts > Add an Alias (on bottom left)

  • Can i add a second email address to adobe digital edition account

    can i add a second email address to adobe digital editions?

    If you mean you want to add a second email address to the Mac Mail app:
    Open Mail > Preferences > Accounts > Click the plus sign and enter the information
    If you mean you want to add an alias to your iCloud mail account:
    Go to https://www.icloud.com > sign in > Mail > Click the Gear on top right > Preferences > Accounts > Add an Alias (on bottom left)

  • How do I add a second email account in ICloud mail

    How do I add a second email account to my iCloud mail, like a POP account?

    I talked with Apple and they have taken away the ability to check other email addresses on iCloud like you could in MobileMe via POP or whatever.
    Not sure why I would use iCloud if I can't check all of my email there, and I'm certainly not going to configure four POP accounts on my phone, my laptop, ipad, and work computer...
    Bummer...I'm going back to Gmail.

  • How can I add a second email account to my IPad

    How do I add a second email account to my Ipad

    Settings>Mail, Contacts, Calendars>Add Account.

  • Dislaimer for all outgoing mails, excepting some domains?

    I'm still trying to add a Disclaimer to all outgoing mails. Actually, I need some help to add such a Disclaimer to nearly all outgoing mails, excepting some specific domains and for the right syntax:
    I know that I can add a message filter with the action 'add-footer' through CLI like this:
    if (recv listener == "OutboundMail" AND (not only-body-contains ('some unique text from my company disclaimer'),1)
    {add-footer('name of previously in GUI added dislcaimer-text');}
    else
    { deliver();}
    My questions:
    a) How can I prevent such a Disclaimer for every recipient in the domain "@company-without-disclaimer.com"?
    b) How should I write that for multiple recipient-domains without disclaimer?
    c) Is it important to write the listener-name and the disclaimer-name in the above code with ' (single quote) or " (double quotes)?
    d) Are the brace brackets {} set correct?
    e) Should I enter the entire disclaimer-text for the body-scan? I'm not sure if our actually one is 'unique' - maybe other companies has the same or a very similar one. Should I add multiple parts to looking for? How do you do that?
    Thank you for every help in advance!

    I can't figure out how to add the NOT-command.
    It works for me as written in my previous example.
    And could you please tell me something to my other questions c), d) and e)?
    "C" and "d" are very basic questions documented in the "Message Filters" section of the Advanced User Guide. Single or double quotes are both fine. The curly braces are probably OK as you've written them, but putting whitespace around them might be necessary (the docs don't say).
    As for the disclaimer text, that's hard to get perfect. It depends on your threat model. If you just want to be reasonably well assured that it gets put in, then pick out some bit of the disclaimer that is unlikely to appear elsewhere and check for that. But if you want to make sure that your own people can't spoof the process by embedding that bit in a message in order to avoid getting the disclaimer (not a likely threat in my opinion), then you'd need to check for the whole thing. Depending on how long it is, it might be safer to check for it piecemeal rather than all at once. I really can't say since I've never tried this. Or you could just add the footer unconditionally. At worst, you'd only end up with multiple instances of the footer in some messages, and it would only be in those messages which pass through your ESA more than once.

Maybe you are looking for

  • Event based decision

    Hi every one, I am working with jcaps 5.1.3. I am doing a business process to implement timer event, following user guide of eDesigner on page 63. I want to receive a message on my business process and do anything whit this message, but I want to con

  • Transporting data between sybase and oracle

    I want to know how do you transport data from sybase to oracle. The table are created in sybase and we want to move everything over to Oracle8i

  • How do I pixelate a photo in aperture?

    How do I pixelate a photo in aperture?

  • Calling a subroutine referenced in a variable?

    Can anyone tell me if there is any way in AppleScript to store a subroutine reference in a variable in such a way that the variable can then be used as though it were a subroutine itself? As an experiment, I tried this: set selectedSub to a reference

  • Updating to iOS 7.1.2

    I tried updating my iphone 5s to iOS 7.1.2 but it's frozen on a screen. It has an all black screen with the iTunes logo and a cord icon at the bottom. Above the corn icon is an arrow pointing to the iTunes icon above it. I disconnected it from the ch