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
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
- Within the dialog, highlight the URL – and right-click + copy
- 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
- Check the URL – and you have ALL you need
http://SERVER:PORT/_layouts/ListEnableTargeting.aspx?List={297def5c-019d-4786-b0b5-fec2099200f5}
===========================================================
These tips/tricks have save me LOTS of time – hope they help you too…!
![]()
May 4, 2012 at 6:54 am
This is useful. Thanks,
May 10, 2012 at 7:10 am
Thanks for the tips. Really Useful