Select Page

Lync location Information Services (LIS) automation script

Lync location Information Services (LIS) automation script

Lync Location Information Services

Lync server includes the Location Information service (LIS), which provides location information to clients such as Lync desktop and Microsoft Lync Phone Edition. Location information is stored in a dedicated database LIS in the central management store. The cool thing about this, is that you can map your physical subnets for example, with an actual location. When Lync client signs in, it will attempt to map the subnet that the machine is connecting to, with the subnet information stored and configured in the LIS. Finally, Lync client will display the location information accordingly.

The command that is used to set and map subnets to location is Set-CsLisSubnet

This cmdlet will associate the subnet with the physical address Contoso Corporation, 123 Contoso Way, Redmond,  WA, 73291, United States.

Note: After mapping location information to network subnets using the preceding cmdlets, use the cmdlet Publish-CsLisConfiguration.

The script that will simplify everything

The tricky part about populating the Lync location information services with location information, is the ability to maintain sch information, as the physical subnets are changed or new one get introduced. So, let us start with two simple facts:

  • Lync location information services or LIS takes C subnet network. So, if you have /22, then you have to use the Set-CsLisSubnet four times. One for and another three times for
  • If you have already entry for for example, and you re-entered the same subnet with different location information, the old entry will be overwritten.

Saying that, what i usually do is to maintain a sheet with the following fields :

  • Subnet
  • Description
  • Location
  • CompanyName
  • HouseNumber
  • HouseNumberSuffix
  • StreetName
  • StreetSuffix
  • PostDirectional
  • City
  • State
  • PostalCode
  • Country

Then I start adding my Class C subnets to the sheet, and populating each subnet with location information. All fields are optional except the Subnet field, as it acts as an identifier.

Once I have my sheet ready, I will use the my Set-CorpCSSubnet.ps1 script to import that csv file to Lync location information services.

When I have changes in my subnets and location information, I can run the script again without worrying about duplicate data in my Lync location information services as it will always overwrite old with new information.

The script will take two parameters:

  • Script working directory: example can be c:\users\john\desktop. We use this path to generate error file and read the csv file
  • Sheet name: example can be mysheet.csv which is the csv file to import data from.

The script will also generate an error file that contains which subnet information could not be imported to the Lync location information services, so you can track such errors and maybe fix the input data in your sheet.

Lync location Information Services

The CSV file should have all the fields, but you can only fill the fields that you care about. Say for example you want just to fill the SubnetDescriptionCompanyName and Country fields. Then the csv will look like this :

Lync location Information Services 2

On the other hand, if you want only to fill the Subnet and Description information, the csv file should look like the below.

Lync location Information Services


About The Author

Ammar Hasayen

Ammar is a digital transformer, cloud architect, public speaker and blogger. He is considered a trusted advisory with the ability to quickly navigate complex multi-cultural organizations and continuously improve and motivate cross-functional teams to achieve higher productivity, collaboration, revenue gain and cross-group knowledge sharing. His contributions to the tech community helped him get awarded the Microsoft Most Valuable Professional. Ammar appears in a lot of global conferences, and he has many publications about digital transformation and next generation technologies.

Leave a reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Hi, I’m Ammar Hasayen


About Me

Cloud Architect | Cybersecurity | CISSP | Microsoft MVP | Pluralsight Author | Book Author | International Speaker | World Explorer | @ammarhasayen


LinkedIn Profile

My Pluralsight Course

Speaking at Microsoft Ignite Dubai

Ammar Hasayen Speaker Ignite

Pin It on Pinterest