Automate Sip Address and UPN name changes in Lync / Skype for Business

Active Directory, Exchange, Lync / Skype for Business

When a person’s name changes a lot of organizations implement different strategies of keeping relative addresses in sync. For Lync / Skype for Business and Exchange purposes the four attributes that are important are mail, proxyAddresses, msRTCSIP-PrimaryUserAddress and userPrincipalName. For the best Lync / Skype for Business login experience it is important to keep the sign in address, e-mail address and user principal name the same.

Presuming you are utilizing an Exchange e-mail address policy that changes the e-mail address for users according to their new name, I will show you how to automate the change of the msRTCSIP-PrimaryUserAddress and userPrincipalName attributes. You can automate this by having the script run as a scheduled task. If your organization does not utilize a matching user principal name you you can ignore step #4.

Pre-Step: Before proceeding you may need to import the Lync / Skype for Business and Active Directory commandlets on older versions of PowerShell.

Step #1: The first step is to get all Lync / Skype for Business users in the environment. By utilizing the Get-CsUser command only the enabled Lync / Skype for Business users will be returned. (I added a filter to only include email addresses of @yourdomain.com, this can be changed to {WindowsEmailAddress -gt 0} if you want to capture any domain)

Step #2: Now that we have all the Lync / Skype for Business users in our $users variable we can check each of them to identify which sip addresses do not match e-mail addresses.

Step #3: Now we can proceed with changing the Sip Address of each user to match their e-mail address.

Step #4: The next step is to handle the User Principal Name change. To do this we utilize the Set-AdUser command from the Active Directory module.

Step #5: If your users are utilizing Lync / Skype for Business meetings, you will also require the meeting link for the calendar invites that were sent out to be updated. Microsoft has released a tool to cover this change. It is a client side tool that the user whose name changed must run from their desktop. In a future article I will cover how to automate this change by using PowerShell and Exchange Web Services.

Download x86 Lync / Skype for Business Meeting Update Tool
Download x64 Lync / Skype for Business Meeting Update Tool

That covers all the steps required to automate the change of the Sip Address and UPN. Feel free to leave any comments or questions and I will be sure to answer them.

40 comments

    • +1

      Hi Steve (and Amanda),

      Sorry to resurrect this, but we too are *really* looking for a PowerShell/EWS tool like this – we’re planning a SIP change and this would be very helpful to users!!

      Anyone have any luck?

      -Rob

        • That would be great! Thank you! Looking for a way to PM you my contact info and haven’t found it. Can you point me to best method, or does my email address (required to post this message) suffice?

          Thanks again!
          Rob

      • …. and it failed for SIP address change (uname@domain.com -> user.name@domain.com). This is approximately 24 hours after uname@domain.com got changed to user.name@domain.com:

        2015-11-04 16:14:32,739 [6] INFO [MeetingLibrary.LyncUtility] Get ConferenceScheduler for sip: uname@domain.com

        2015-11-04 16:14:32,785 [6] ERROR [MeetingLibrary.LyncUtility] SchedulePrivateMeeting, Failed to get inband information. Sip: uname@domain.com Exception details:System.NullReferenceException: Object reference not set to an instance of an object.
        at MeetingLibrary.LyncUtility.GetConferenceScheduler(String sip)
        at MeetingLibrary.LyncUtility.SchedulePrivateMeeting(MeetingDetails meetingDetails)

        2015-11-04 16:14:32,785 [6] ERROR [MeetingLibrary.LyncUtility] SchedulePrivateMeeting, Failed to get ConferenceCapabilities information. Sip: uname@domain.com Exception details:System.NullReferenceException: Object reference not set to an instance of an object.
        at MeetingLibrary.LyncUtility.GetConferenceScheduler(String sip)
        at MeetingLibrary.LyncUtility.SchedulePrivateMeeting(MeetingDetails meetingDetails)

        2015-11-04 16:14:32,785 [6] ERROR [MeetingLibrary.LyncUtility] SchedulePrivateMeeting, Failed to get conferenceScheduler. Sip: uname@domain.com Exception details:System.NullReferenceException: Object reference not set to an instance of an object.
        at MeetingLibrary.LyncUtility.GetConferenceScheduler(String sip)
        at MeetingLibrary.LyncUtility.SchedulePrivateMeeting(MeetingDetails meetingDetails)

        It ran “successfully” (though unnecessarily) for meetings scheduled as user.name@domain.com.

        (hope I’m not distracting you from the PowerShell/EWS method, which just has to be way better than this – I’m willing to deal with a very unrefined tool at this point.)

        • We were having issues with the tool as well until we completely patched Windows 7 with every possible Windows Update patch. Give that a go first. Yes I keep knocking on Microsoft’s door for the query I need to get the new link information from SQL but have not received it yet.

          • And by “close,” I mean that I’ve gotten to the point where if you give me their new SIP address, I’ll give you all the meeting codes, which combined with their SIP domain’s Simple URL for meeting joins, will give the right link for each meeting, as well as the meeting titles and other information (do PSTN joiners have to wait in a lobby, etc).

            What info did you need?

  • Caveat: I’m getting that info in a rather unsupported way, and there’s nothing external preventing MSFT from changing that the next time they do a database update for Lync/SfB.

  • Hi Steve
    As I’m planing for a SIP address change on 500+ user, I’d also like to have some information via PM, same as Rob Swenson got. Is that possible?

    Regards Jonas Didriksson

  • I have a SIP domain change for 6000+ user to do. Interested in your automation procedure by using PowerShell and Exchange Web Services. You can email me.

      • In the meantime we solved the problem by doing a URL redirect in the internal and external IIS websites of SfB (IIS “URL Rewrite” option). If a request for the old URL comes in we redirected it to the new URL (in our case the old SIP extension is no longer in use after the migration). It works fine this way.

  • Hey Steve,

    We’re moving our users to SfB Online, and the meeting update tool actually doesn’t work correctly in this instance. Specifically for meetings that the migration tool is run against, the meeting join URL and dial-in conference ID do not seem to sync up properly. New meetings work fine, its just migrated meetings.

    I have a feeling your closed source tool might get us closer to figuring out a resolution to this issue. Do you mind sharing with me via email? Thanks man!

    P.S. – I have a pretty detailed write-up of the full migration tool issue and the steps we’ve attempted to resolve if your’e interested.

    • Did you reach out to Microsoft on the tool issue? The tool will need to be run after the user’s SIP has changed.

  • Hello Steve,
    would it be possible to get a version of your centralized Tool?
    I would really appreciate to test it.

    Best regards,

    Udo

  • Hello Steve,

    we are planning to move the our 5000 Lync 2010 users to SFB online. We don’t want users to run the meeting migration tool. Could you help me to automate this.

    • Sure, contact me and I will be able to help you out. If you simply upgrading to Skype you will not require meeting changes. The only time you would need that is for a domain change or mass e-mail address/sign-in address changes.

  • Thanks for your reply Steve. We are moving the users from On premises to Microsoft cloud. Since the number of users is more than 5000, we don’t want to run the meeting update utility from client machines. searching for some solution to get this done from server side. I hope this is workable. Please share your contact details so that I should contact you.

  • Hi Everyone,

    We are planning a change for SIP Address for more than lakh users , can anyone help me with the custom solution which we are talking about here.

  • Just wondering, you don’t change msRTCSIP-PrimaryUserAddress ? One of the previous command is changing that attribute too ?
    ty
    /s

  • We are looking for a automation process on Skype Business Migration Tool. I can push the install out through SCCM 2012 but the application that takes you through the process we need to “automate” those steps. Can you assist with that???

    Step #5: If your users are utilizing Lync / Skype for Business meetings, you will also require the meeting link for the calendar invites that were sent out to be updated. Microsoft has released a tool to cover this change. It is a client side tool that the user whose name changed must run from their desktop. In a future article I will cover how to automate this change by using PowerShell and Exchange Web Services.

  • Hello.

    We are gonna migrate 2000 users to Skype for Business and at the same time change the UPN to email adress in Skype.
    I wonder if you could be kind enough to share your Powershell script for changing meeting URLs after migration?

    Morten Holst

Leave a Reply