Home » Archive » Adding Locations to Lync 2013 without using E911

Adding Locations to Lync 2013 without using E911

Automatic setting of users location in Lync is controlled by the users subnet and the lync location database. The location database can only be accessed using Lync Management Shell. Microsoft supported process is to configure location policies with E911. However, if you are not in the USA like me E911 is pretty much useless. Fortunately, you can use the location database independently and without any location policies in Lync. By entering subnet and site data directly into the database you will ensure that if the subnet the lync client is on is listed in the location database this will be automatically updated when the user signs in.

To achieve this create a csv file called subnets.csv with column headers of Location, Subnet, City and CompanyName

Fill out the location column with the site location name you want e.g “HQ”, the Subnet will be (it only works with /24), City Name and the Company Name

UPDATE FEB 2015 – I have created a simple webpage that will generate the CSV file for you. Working on large deployments with /8 subnets can be quite tedious to display all the /24 subnets within this range. So 10 minutes of PHP coding I was able to save hours of pain. http://www.hostedhouse.co.uk/subnets.php 

Then use this Powershell Script to update the Lis Database

$File = "C:\subnets.csv" $Log = New-Item -ItemType File -Path "C:\subnetlog.txt" -Force
#Import csv $sitecsv = Import-Csv -path $file -Delimiter ','
#Check if user file is empty. if ($sitecsv -eq $null) {  write-host "No subnets Found in Input File"  exit 0 }
#Get total number of users in CSV file and begin processing.
$count = $sitecsv | Measure-Object | Select-Object -expand count
Write-Host "Found " $count "subnets to import." Write-Host "Processing subnets.....`n" $index = 1
ForEach ($site in $sitecsv)
Write-Host "Processing subnet " $index " of " $count -ForegroundColor Cyan $location = $site.Location $subnet = $site.Subnet $city = $site.City $company = $site.CompanyName
#Check subnet exists. Log if they are NOT.
$checksubnet = Get-CsLisSubnet | Where-Object {$_.Subnet -eq "$subnet"}
if ($checsubnet -eq $null) { $notinad = $true
Set-CsLisSubnet -Subnet "$subnet" -Location "$location" -City "$city" -CompanyName "$company"  Write-Host "Location Added Successfully" -ForegroundColor Green
else { $notinad = $false
Write-Host "User " $subnet " is is already added to database." -Foregroundcolor white -BackgroundColor Red Add-Content -Path $Log -Value "$($subnet) is already added to database."
$index++ }
Write-Host "Importing of subnets from CSV completed! Now publishing Dataabase Config"
Write-Host "Completed"


Leave a Reply to Mark Garza Cancel reply

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

%d bloggers like this: