How to Script Location Information Service (LIS) database

Here’s a script that will quickly populate your LIS database.

Copy the below into a file and name it something.ps1 (i named mine lis.ps1)


##This script will allow you to populate your LIS database quickly based upon subnets. You will need to create a CSV file with the following in the first row of each column
##Subnet, description, location, company, number, street, streetsuffix, city, state, postalcode, country

##asks for a CSV file with the required information
param( [string] $importfile = $(Read-Host -prompt `
“Please enter a file name”))

$locations = Import-CSV $importfile

foreach ($location in $locations)

Set-CsLisSubnet -subnet $location.subnet -Description $location.description -location $location.location -CompanyName $ -HouseNumber $location.number -StreetName $location.street `
-StreetSuffix $location.streetsuffix -city $ -State $location.state -PostalCode $location.postalcode -Country $ -Verbose



Create a csv file with the required headers.  Example:


Add all relevant information that you need.  Example, my addresses do not need a street “housenumbersuffix”.  For a complete list of options please see

Save the file to a location.  Run lis.ps1 and it will ask you for the csv file.  Provide the command a location for where you saved the csv file and hit enter.  It will then loop through all the subnets you have in the CSV file and update them all.  Key word here is UPDATE.  Lets say you have an existing already in LIS, when you run set-cslissubnet, because you have a in your CSV file, it will overwrite the information already stored in LIS.


After running the script…don’t forget to run publish-cslisconfiguration.  If you don’t none of the new data will be merged with the CMS and thus replicated around.