Find and Test User IP Addresses in the Skype Location Database

By | December 20, 2017

I don’t know about you, but I love the Skype for Business location database. You know that little thing that automatically updates your location based on where you are? it doesn’t? Maybe you need to check your LIS config!

As a Skype4B admin setting the LIS up can be a bit of a pain as it requires detailed information from the networking team on each individual subnet in the customers topology and what I find more often than not is that the data provided by the networking team is SuperNetted.
Note
: if you know how LIS and supernetting work, skip ahead, but for the rest of us..

About the LIS

The LIS database doesn’t maintain a list of Networks and Subnet masks like CAC and other applications in Skype do, when using IP addresses it relies entirely on the NetworkID of a user to figure out where a user is located.
This NetworkID is calculated by doing some simple math on the users IP address and Subnet mask at the client side and has no regard for routers or even the networking teams map of IP addresses.
For those not of a networking background a NetworkID is the first address of a subnet and it is unusable

To calculate the NetworkID of a user, the Skype4B client simply grabs the current IPAddress and Subnet mask of the client machine, discards the host bits and is left with the NetworkID. What are the host bits? That’s what you tell windows when defining a Subnet mask. Any bits set to 1 in the subnet mask are network bits and any bits set to are host bits. But as we humans aren’t too good with binary we represent it as multiple 8 bit numbers.. hence the term octets (8 bits) I can divulge into deep networking here, but that’s really out of the scope of this article.

In the example below. We have a Mask of 255.255.255.0 also known as a /24 as 24 bits are used for the NetworkID

This means the first 24 bits of the IP address are the NetworkID (in green) and the last 8 bits are the Host Bits (in red)

Okay, that’s nice. So now I can be a Cisco engineer. What does that have to do with the LIS?

This is where SuperNetting comes into play. Quite often, network engineers assign blocks of subnets to levels, buildings, locations and then roll these “blocks” of subnets up into SuperNets in their documentation. From a routing perspective this is fine and in fact the preferred method to keep CPU load low. But when a network admin provides a location map. They may say “Location A 10.10.8.0/22” or “Location A 10.10.8.0 255.255.252.0” when in actual fact in this SuperNet is several smaller networks that have been summarized into a SuperNet

10.10.8.0 255.255.255.0
10.10.9.0 255.255.255.0
10.10.10.0 255.255.255.0 (Our Client is here)
10.10.11.0 255.255.255.128
10.10.11.128 255.255.255.128

This is important to understand because the Skype4B client is not aware of these other networks so when it performs the LIS lookup process it will look for its own network ID
Our client in this case looks at the IP and Subnet mask and determines a NetworkID of 10.10.10.0 and if we haven’t performed our due diligence on the data provided by the network administrator the entry for the subnet 10.10.10.0 wont exist.. only 10.10.8.0 thus the client fails the LIS lookup and moves on to other methods to determine the users location.

What does this tool do then?

I wrote this tool as a quick and simple way to test if a users IP address is present in the LIS database.

Simply run the tool specifying the IP Address and Mask from machine with the Skype4B management tools installed and it will calculate the network ID based on the details you provided. Then query the LIS db for that NetworkID
If the Subnet is present it’s details will be returned. If not the script will provide feedback suggesting the IP isn’t present or warn you of multiple matches.

You can specify either IP Address and Subnet Mask, or CIDR notation for network nerds like me.

Successful lookup

Failed lookup

Download

You can grab it from the TechNet Gallery here Download

Fork Me

As alot of my code is open source, I’ve moved from storing my Git repo on VSTS over to GitHub. Feel free to fork the code for your own purposes over here

https://github.com/Atreidae/Test-CsLisIpAddress

Version History

1.01

Minor Bug Fix Release
Fixed Synopsis
Fixed Auto Update URL
Fixed Various Typos
Logging Improvements
Flattened GitHub structure

1.0

Initial Release

13 thoughts on “Find and Test User IP Addresses in the Skype Location Database

  1. Pingback: Automatic Australian Holiday Rulesets for Response Group Service | Skype4BAdmin.com

  2. Vitaliy

    Would it be possible to use this information and retrieve the LIS details for a registered endpoint? Thank you.

    Reply
    1. James ArberJames Arber Post author

      Unfortunatey. No. But I do have some code that does this as part of RGSLocBot. I could package that into a small script I suppose.

      Reply
        1. James ArberJames Arber Post author

          I’ve got some code “working” I’m just making it a bit more functional.
          What were you intending to use it for?

          Reply
          1. Vitaliy

            It would be very helpful to get the location details of a device that dropped off the network. Better yet, it would be amazing to have this information overlaid onto a campus map 🙂

          2. James ArberJames Arber Post author

            I have a beta up here, https://github.com/Atreidae/Get-CsUserLocation I wouldn’t call it finished code yet as you have to hard code a service account username/password into the script. I’ll harden it up a bit later.

            As always with anything, especially beta’s use at your own risk.
            Remember this will only return the users location if the LIS is correctly configured or the user has manually set it.
            Have fun.

          3. Vitaliy

            I’ve had a chance to run the script in a Lync 2013 (Standard Edition) environment. The user that I’ve inputted has the CSViewOnlyAdministrator group membership. However, I do get an error.

            The first one is that it can’t find the SkypeForBusiness module (its Lync 2013 so I commented those pieces out. The final error I get is “We couldn’t AuthN with the username & password provided. Update and try again.”. I’ve double checked the user password.

            What are the requirements for this user?

          4. James ArberJames Arber Post author

            Not 100% sure on the user requirements yet (I did day it was a beta) but as long as the user can sign in and pull the users status it *should* be okay.
            is the user Lync enabled? your effectively logging into Lync/Skype4b pool
            as a user via the Reverse Proxy using UCWA. IE not using PowerShell cmdlets. So RBAC roles should be Irrelevant.

          5. Vitaliy

            I did enable the user for Lync but I get the same authentication error. I’ve tried several variations of the username DOMAIN\USERNAME and just the username, username@sipdomain.com. Not sure. But I do understand that its beta and I appreciate you putting any time into this at all.

          6. Vitaliy

            We are not running multifactor auth. Yes, user is on-prem. I dont believe that modern Auth is available or Lync 2013.

            I’ll open the issue on github as well.

        2. James ArberJames Arber Post author

          I’ve published a new build that should auto update. it just adds a few logs to the authentication process

          Few questions
          – Are you running Multifactor Auth?
          – Is the user homed on prem
          – Have you enabled modern Auth

          Ideally we can track this issue in the github thread

          Reply

Leave a Reply