I had a requirement to assign a SIP address to each AD account on my domain, this is to facilitate a rollout of Skype for Business. The lack of a SIP address stops Skpe (Lync) from autodiscovering the users address. The SIP value is stored in the ProxyAddresses attribute, however you can store it in the msRTCSIP-PriamryUserAddress attribute as long as you have extended your AD Schema.
Without the SIP present, users will see the following when launching SFB (Skype for Business)
After running the script, your attribute should look something like this:
Script:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Sets UPN to ProxyAddresses AD field for SIP entry | |
.DESCRIPTION | |
Script will search through active directory and set all users with NO SIP address to have a SIP matching the users UPN | |
.PARAMETER $OU | |
Enter full distinguised name of OU you wish to limit search to | |
.NOTES | |
Version: 1.0 | |
Author: dpadgett | |
Creation Date: 07/02/17 | |
Purpose/Change: Initial script development | |
.EXAMPLE | |
Set-SIP.ps1 -OU "OU=Development,OU=Users,DC=company,DC=Group" | |
#> | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[ValidateScript({Get-ADOrganizationalUnit $_})] | |
[string]$OU | |
) | |
$results = Get-ADUser –Filter * –Properties DisplayName, SamAccountName , UserPrincipalName , proxyaddresses –SearchBase $OU | | |
Select DisplayName , SamAccountName , UserPrincipalName , @{Name='SIPproxyaddresses';Expression={($_.proxyaddresses | Select-String –Pattern "SIP:")}} | | |
Where-Object {$_.SIPproxyaddresses -eq $null} | |
ForEach($user in $results) | |
{ | |
$samAccount = $user.SamAccountName | |
$SIP = "SIP:$($user.UserPrincipalName)" | |
Write-Host "Setting $samAccount – SIP; $sip " | |
Set-ADUser –Identity $samAccount –Add @{proxyAddresses=$SIP} | |
} | |