SharePoint PowerShell Locate Libraries with specific Columns

Here’s a little PowerShell Script I wrote to list all Document Libraries that contain a specific Column. I have specifically checked to see if the BaseTemplate is a library, however you can remove that part of the script and look for all Lists or a specific List type e.g. announcements or calendar.

It can be easily modified to display other details using these documents as a reference:

SharePoint List Properties:

SharePoint Field Properties:

 $s = Get-SPSite http://sharepoint
 $wc = $s.AllWebs
 foreach($w in $wc){
   foreach($l in $w.Lists){
    if($l.BaseTemplate -eq "DocumentLibrary"){
      for ($i = 0; $i -lt $l.fields.Count; $i++)
        if($l.fields[$i].Title -eq $fieldname){
          write-host $l.ParentWebURL,",",$l.Title,",", $l.fields[$i].Title,",",$l.ID

Another useful script is this one to export a list of Site Columns and Associated Lists:

$web = Get-SPWeb http://sharepoint
$column = $web.Fields[$fieldname]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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 )

Connecting to %s