Thursday, October 20, 2011

Changing SIP address on multiple users

There are many reasons to change multiple users' SIP domain.  Maybe you acquired a company and are bringing them online with their existing domain name.  Maybe a branch office is planning to do business under a new domain.

Adding a new SIP domain is simple enough in the Topology Builder, and when creating new users it is easy to select the new SIP domain, but when it's existing users converting to the new domain, it’s a lot of clicking in the Lync Control Panel, so I found a nice easy way to do this.

In this example, I have two SIP domain's, contoso.com, and Contoso's new doing business as SIP domain of nwtraders.com.   The entire Boston office is switching over to this, so I am able to select based on Registrar pool, but you can also filter by OU, or any other attributes the users share.

$userscope = Get-CsUser | where { $_.RegistrarPool -eq "boston.contoso.com" }
foreach ($item in $userscope)
    {
        $oldAddress = $item.SipAddress
        $newAddress = $oldAddress -replace "@contoso.com", "@nwtraders.com"
        Set-CsUser -Identity $item.Identity -SipAddress $newAddress
    }


No comments: