Enable Geo Location column using PowerShell in SharePoint 2013

To integrate maps and Geo Location in SharePoint, Geo Location column has been provided in SharePoint.

Which will not visible by-default. We can add this column in particular site, web or list.

One thing i need to specify that SharePoint 2013 uses Bings Maps to render the map of the location stored in Geo Location column.

To add Geo Location column we need powershell with admin user login.

Create PowerShell script add following code and save as demo.ps1

$fieldXml = “<Field Type = ‘Geolocation’ DisplayName=’Geo Location’ Name=’geolocation’ Group=’custom fields’/>”
#get spweb object
$web = Get-SPWeb “YourSiteName
$web.Fields.AddFieldAsXml($fieldXml)
$web.Update()

In this Code replace “YourSiteName” with your “site url”. You can also change display name of column.

Now run this PowerShell script. Geo Location will be added in your site column. Now you can add this column in your list/library.

Thank you for reading.

Code, Play and Learn…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s