Automate Sip Address and UPN name changes in 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.

Print Friendly, PDF & Email

59 Comments

  1. Pingback: Automate Sip Address and UPN name changes in Lync / Skype for Business » PowerShell.org

    1. Rob Swenson

      +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

        1. Rob Swenson

          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

      1. …. 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.)

        1. Steve Parankewich

          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.

          1. 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?

  2. Jonas Didriksson

    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

      1. Geert

        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.

      2. Morten

        Hi Steve
        Do you have any info on the open source method?
        We found out that Microsoft tool isn’t working for every user, so we’re holding back on changing the SIP address. We’re 5000+ users

        1. Steve Parankewich

          We moved to Skype Online which does not allow you to grab the new/old method so I abandoned that open source method. What have you found with Microsoft’s tool not working 100%?

  3. Drew Turner

    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.

  4. Vishnu Dutt

    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.

    1. Steve Parankewich

      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.

  5. Vishnu Dutt

    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.

  6. Pingback: Automate Sip Address and UPN name changes in Lync / Skype for Business | MS Tech BLOG

  7. Karen

    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.

  8. 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

  9. Alistair Wilson

    Hello

    I am looking at changing some UPNs and SIP Addresses – the part about changing meeting URLS would be awesome to get -so if I can get a copy of the powershell that would be appreciated.

    However, is anyone out there aware of a process to allow the client’s sign in address to be changed when they log in after the changeover?

    That would be something very useful!

    Thanks

    Alistair Wilson

  10. Markus Gruber

    Dear Mr. Parenkewich,

    As many other, I am highly interested in your script solution to update Skype for Business meeting invites with the most recent information via Exchange Web Services.

    I would be glad hearing from you regarding this topic.

    Regards,

    Markus Gruber

  11. Henk Tittel

    Dear Steve,

    We have some users who SIP record changes due to switches internally companies, marriage, divorce and so.
    Most off these user have numerous meetings in their outlook, now I saw you had an solution which you could not share in public, could you be so kind to sent me an mail?

    Kind regards,

    Henk

  12. Rajesh

    Hello Steve,

    we are planning to move the our 500+ SFB users from one service provider to another. We don’t want users to run the Meeting Update Tool for Skype for Business and Lync. Could you help me to automate this through powershell from Server side. Thanks a loot……

  13. Thomas

    Hello,

    We are planning a email & SIP domain change for around 6000 people and we are looking for a way to reduce user impact.
    I’ve read your post about changing the SIP domain and the promise of a tool to update Skype Meeting from the server-side catched me!
    Can you provide me with information on your ‘closed source solution’ and your open source solution ?

    Best regards

      1. Henk Tittel

        Dear Steve,

        Yes we are still looking for an solution when users change their mail addresses, currently this means that the users or their secretaries manually have to redo all existing skype for business meetings.

        Kind regards,

        Henk

Leave a Reply

Your email address will not be published. Required fields are marked *