Powershell to add a geolocation site column in SharePoint 2013

SharePoint 2013 introduces a new Geolocation field to help us integrate geolocation information and maps into our applications.

Here is a great introduction to it:


Unfortunately, we cannot create a new column based on the new geolocation type from SharePoint user interface. It has to be done from powershell or programmatically.

The powershell script below will create a geolocation site column for a site:

$weburl = "http://somesite"

$fieldXml = "<Field Type ='Geolocation' DisplayName='Location' />"

$web = get-spweb $weburl

$field = $web.Fields.AddFieldAsXml($fieldXml)




Comments (0)

Skip to main content