No announcement yet.

Add proxy addresses to specific users

  • Filter
  • Time
  • Show
Clear All
new posts

  • Add proxy addresses to specific users

    Hi Folks,
    In our Exchange 2013 environment, users have multiple proxy SMTP addresses. I need to add a new proxy SMTP address for specific users; those are in large numbers. while looking to different forums - i have broken this task into steps.
    1. Add an accepted domain by using following command
    New-AcceptedDomain -Name "Domain Test B" -DomainName -DomainType Authoritative
    2. Add Proxy SMTP address to all users by using following command

    $users = Get-Mailbox

    foreach ($a in $users) {$a.emailaddresses.Add("$($a.alias)")}

    $users | %{Set-Mailbox $_.Identity -EmailAddresses $_.EmailAddresses}
    step 3: use a filter to exclude specific users those have primary SMTP addresses as ""
    Get-Recipient | where {$_.emailaddresses -match “”} | select Name, Emailaddresses
    step 4: Remove proxy SMTP address from those users who have "" as their primary SMTP address.
    This is where i am looking for help. I am trying to use output provided by step 3 command to remove proxy SMTP address from the users having primary SMTP address as ""
    I am using following command with no luck.
    >Get-Recipient | where {$_.EmailAddresses -match ""} | Set-Mailbox -EmailAddresses @{Remove=""}
    Please assist or suggest any other way!
    Note: i do not want to achieve this by using CSV file.