Announcement

Collapse
No announcement yet.

Add aditional smtp address

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add aditional smtp address

    Hi all.
    I am working on a migration from groupwise to Exchange 2007. All data and account have been migrated, but there is a problem with the SMTP adddresses. All SMTP addresses have been created according to the address policy in Exchange 2007. Wich is OK for let say 80% of the users. For 20% however the SMTP address changed.

    Now i have to make sure that the SMTP address used in groupwise is the same in Exchage 2007. To do so i created a powershell script:
    Code:
    Import-Csv -Path "C:\batch\custom.csv" | 
    ForEach-Object { 
    $Identity = $_.Identity 
    $mailbox = Get-Mailbox -Identity $_.Identity 
    $newaddress = $_.SMTPAddress 
    $mailbox.EmailAddresses += "SMTP:$newaddress" 
    $mailbox | Set-Mailbox }
    when i run the script two strange thing happen:
    1. The script loops indefinetly
    2. the script returns: "The command complted successfully but no settings of username/ADlocation has been modified.

    What am i doing wrong?
    [Powershell]
    Start-DayDream
    Set-Location Malibu Beach
    Get-Drink
    Lay-Back
    Start-Sleep
    ....
    Wake-Up!
    Resume-Service
    Write-Warning
    [/Powershell]

    BLOG: Therealshrimp.blogspot.com

  • #2
    Re: Add aditional smtp address

    Resolved the issue with help from Google (http://www.experts-exchange.com/Soft...3520072.html):

    Code:
    Import-Csv C:\batch\custom.csv | ForEach-Object { 
    $Temp = Get-Mailbox -identity $_.identity
    $Temp.EmailAddresses.Add($_.SMTPAddress)
    Set-Mailbox -Instance $Temp
    }
    Can't understand why my previous script did not work. It seems the more logical approach.
    [Powershell]
    Start-DayDream
    Set-Location Malibu Beach
    Get-Drink
    Lay-Back
    Start-Sleep
    ....
    Wake-Up!
    Resume-Service
    Write-Warning
    [/Powershell]

    BLOG: Therealshrimp.blogspot.com

    Comment

    Working...
    X