SharePointRoot

Get SPWeb + SPList GUID – quickly !

2 Comments

When developing webparts and/or CAML for a query – such as jQuery+JSON – or whatever purpose, you might be needing/wanting to get the “GUID” of the current web.

This is a bit tricky – and more annoying than anything.

There are some Powershell scripts – and awesome tools like CAML Builder – or SharePoint Manager – but if you don’t have those – and need it quickly, I have a great tip for you…

  • Click Site Settings
  • Click Content And Structure
            • You might need to “go to root site settings” – if you’re within a sub-site

image

OR – you can simply enter the URL…>

http://SERVER:PORT/_layouts/sitemanager.aspx

  • Within the Manage Content and Structure screen, find the site you want to check the GUID.
  • Here’s the trick – need to RIGHT-CLICK on the URL – and then select PROPERTIES

image

  • Within the dialog, highlight the URL – and right-click + copy

image

  • Then, open a new Notepad screen – and click Paste

javascript:__doPostBack(‘TreeView1′,’sArea:?SPWeb:10640412-d27e-433c-abd1-795462d3fa60:\\SPWeb:c609ba9e-2ff2-413f-ba0c-034ba392dc18:’)

  • Within the URL, the first bit is the GUID of the Site Collection
  • The second part is the GUID of the SPWeb (ie. the WebSite you want !)

Just take a copy of the GUID – and you can then use wherever you need/want.

===========================================================

To get the GUID of a particular LIST – you can use the same approach.

  • Choose the list you want, and right-click
  • Copy the URL, and paste into Notepad

javascript:__doPostBack(‘TreeView1′,’sArea:?SPWeb:10640412-d27e-433c-abd1-795462d3fa60:\\SPList:0e6b1ecd-8573-44ab-b175-9ba561b9571a?SPWeb:10640412-d27e-433c-abd1-795462d3fa60:’)

===========================================================

Yet another easy way to get an SPList GUID is to look at the “Settings” page for a list.

  • Switch to the List tab (in SP2010) – or just click Settings (in SP2007)
  • Click List Settings
  • Click on Audience Targetting Settings

image

  • Check the URL – and you have ALL you need

http://SERVER:PORT/_layouts/ListEnableTargeting.aspx?List={297def5c-019d-4786-b0b5-fec2099200f5}

image

===========================================================

These tips/tricks have save me LOTS of time – hope they help you too…!

Smile

About these ads

2 thoughts on “Get SPWeb + SPList GUID – quickly !

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

Follow

Get every new post delivered to your Inbox.

Join 30 other followers