I need a script to retrieve the parent-list from a lookup-column. I've already made a script to list all the lists with a lookup column, but I want to know from where the lookup column gets his data. This is what I've got already: The output gives the url, the list-name and the lookup-columnname.
$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 | Sort-Object Title | Format-table -AutoSize -wrap