Summary 
The Lync/SfB Client is getting the sign-in address from the proxyAddresses or msRTCSIP-PrimaryUserAddress (requires Lync/SfB ad schema extensions) attributes.

How to Populate the proxyaddresses attribute
With this approach, we simply populate the proxyAddresses attribute with the corresponding sip/email address with a SIP: prefix. The example below is assuming that your email/sip address is the same as the UPN on your users.

1

2

3

4

5

6

7

8

9

10

#Import Active Directory Module

Import-Module -Name ActiveDirectory

#Loop through all users with 365lab.net as UPN domain

Get-ADUser -Filter {userprincipalname -like "*365lab.net"} | ForEach-Object -Process {

    #Construct SIP address based on UPN

    $SIPAddress = "SIP:{0}" -f $_.UserPrincipalName

    #Populate the msRTCSIP-PrimaruUserAddress attribute with the constructed SIP Address

    Set-ADUser -Identity $_.SamAccountName `

                -Add @{"proxyAddresses"=$SIPAddress}

}

 

Verify that your users have got the proper address with the attribute editor, as below:
proxy