Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

Output all lists lookup columns in a subsite

$
0
0

I need to list all lists that use a lookup column within an spweb, and, if possible, list those lookup columns. Anybody have a script?

I found http://techtrainingnotes.blogspot.com/2015/04/powershell-finding-all-sharepoint-lists.html

This returns everything in the farm, I want to limit to a single spweb. Maybe switch Get-SPWeb from -Limit All to to -Identityhttp://server/subsite/?

$TTNExcludeLists = "Solution Gallery",
               "Workflow Tasks",
               "Master Page Gallery"

Get-SPSite -Limit All | Get-SPWeb -Limit All |
  Select -ExpandProperty Lists |
  Where { -Not ($TTNExcludeLists -Contains $_.Title) } |
  Select -ExpandProperty Fields |
  Where { $_.TypeDisplayName -eq "Lookup" -and
          $_.Hidden -eq $false -and
          $_.FromBaseType -eq $false } |
  Select {$_.ParentList.ParentWebUrl},
         {$_.ParentList},
         Title

Thanks.



Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>