Tuesday, February 2, 2016

Get SharePoint List ID using powershell

Get SharePoint List ID using powershell

$sitec = Read-Host 'SitecollectionURL'
$subsite = Read-Host 'Enter Sub-Site(ex: departments or ENTER for "root")'
$site = Get-SPSite $sitec
$web = $site.OpenWeb("$subsite")
write-host "Site: " + $site.id
write-host "Web: " + $web.id
$web.lists | Format-Table title,id -AutoSize
$web.Dispose()
$site.Dispose()

No comments:

Post a Comment