PowerShell

Add SIP Address to Match Primary SMTP

Hi All

Here is a little snippet to add a SIP address to a users mailbox so that it matches the users PrimarySmtpAddress.

$mbxes = Get-Mailbox  

ForEach ($mbx in $mbxes) {
# SET THE newSIP ADDRESS VARIABLE TO MATCH THE PRIMARY SMTP ADDRESS:
    $newSIP = 'SIP:' + $($mbx.PrimarySmtpAddress)
    Write-Host "Adding $newSip to" $mbx.SamAccountName

# ADD THE newSIP ADDRESS TO THE MAILBOX:
    Set-Mailbox -Identity $mbx.SamAccountName -EmailAddresses @{Add = $newSip} 
}

Change the $mbxes variable to suit your needs and run.

Worked like a charm 🙂

Leave a Reply

Skip to toolbar