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 10.164.25.0 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 10.10.8.0 /22, then you have to use the Set-CsLisSubnet four times. One for 10.10.8.0 and another three times for 10.10.9.010.10.10.010.10.11.0.
  • If you have already entry for 10.10.10.0 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
    PreDirectional
  • 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 Hasayen is a trusted technology adviser and entrepreneur and has been in the software industry for over 10 years with a special focus on the security, Office 365, and cloud solutions. Ammar is an active blogger and is active speaker in many local tech communities where he talks about Azure and Office 365. A part from that, Ammar appears in many global tech events and conferences like Microsoft Teched and Ignite.

Leave a reply

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

Pin It on Pinterest