Change Lync SIP Address

29. Januar 2013 | In: Active Directory, Lync 2010, PowerShell


## =======================================================================
## Description: MassScript to change SIP Address
## =======================================================================
## Importing PS Modules
Import-Module activedirectory
Import-Module lync

## Active Directory OU Please Edit here the OU Struture
$ADOU = "OU=Users,OU=XOU,DC=domain,DC=local"
"Script working in this OU Path"
$ADOU

## Searching OU Users
$OUMember = Get-CSUser -OU $ADOU

foreach ($member in $OUMember)
{
"-------------------------------------------------------------------------"
"Show old SIP Address for User:"
[console]::ForegroundColor = "yellow"
$member.Name
[console]::ResetColor()
$member.SipAddress
">> Changing to this new SIP Address:"
$sipAddress = $member.SipAddress
$sipAddress = $sipAddress.Replace("@old-domain.com","@new-domain.com")
[console]::ForegroundColor = "yellow"
$sipAddress
[console]::ResetColor()
## Settings are applied to the UserObject here
Set-CsUser -Identity $member.Identity -SipAddress $sipAddress
"-------------------------------------------------------------------------"
}
"-- Script DONE --"


## END OF Script / Certificate


Krypto Kurse

About me