Get metadata column properties from all items in library. Can We Build It?!

sure if you have ever had to need to grab the metadata column values from a huge library in a SharePoint site. Today I needed to grab specific column values from a library with over 50k rows in it. The great thing is with PowerShell you can absolutely do it. Getting the data was easy, but it took me a bit to toss the data into an array so that I could export it cleanly into a .csv file.  Originally I was just dumping it with Write-Out then piping that to Out-File command into a text file, but with Out-file it was putting each column’s value into a new line. (Apparently that’s default with Write-Out in PowerShell). So I had to bite the bullet and use the Export-CSV command. Of course I needed to move my For-Each into an array and that’s when things got fun for a while. Anyways, got it working. As with all my scripts if you see a better way to make this go. Please leave me a comment! Hopefully this helps and saves someone some time in the future. [code language=”powershell”] if((Get-PSSnapin | Where {$_.Name -eq “Microsoft.SharePoint.PowerShell”}) -eq $null) { Add-PSSnapin Microsoft.SharePoint.PowerShell; } $Web = “https://spsiteurl” $ListName = “Shared Documents” $ExportFolder = “C:\ExportPath\” $ExportName = Get-Date -f “dd-MM-yyyy-hh-mm-ss” $ExportPath = $ExportFolder + $ListName + $ExportName + “.csv” $sWeb = Get-SPWeb $Web $sList = $sWeb.Lists[$ListName]...

Read More