I had created a powerShell script to get a list of all the documents added to document libraries across the entire Web Application. But it somehow returned some libraries that did not exist in the error log.

The List Url associated with the error was not to be found anywhere. and this was the error message shown in the log.

one or more field types are not installed properly. go to the list settings page to delete these

I tried to find these lists in the site and also in the SharePoint designer but those could not be found. Can anyone provide me any info on where i can find these lists or why that is causing error.

Any help is appreciated.

The Script

Add-PSSnapin microsoft.sharepoint.powershell


function LogWrite()
    Param ([string]$logstring)
    Add-content $LogFile -value $logstring

function Get-DocInventory() {

            $webApp= get-spwebapplication http://sharepointsite.com/
            foreach ($site in $webApp.Sites) {
                foreach ($web in $site.AllWebs) {
                    foreach ($list in $web.Lists) {

                        if (($list.BaseType -ne "DocumentLibrary") -or ($list.Hidden -eq $true)) {
                        foreach ($item in $list.Items) {

                            $data = @{
                                "Web" = $web.Url
                                "List" = $list.Title
                                "Item ID" = $item.ID
                                "Item URL" = $item.Url
                                "Item Title" = $item.Title
                                "Item Created" = $item["Created"]
                                "Item Modified" = $item["Modified"]
                                "File Size in kB" = $item.File.Length/1KB
                            New-Object PSObject -Property $data
                        $error1= " Error occured at :" + $web.Url 
                        $error2= "Item URL:"+ $listItem.Url

                        LogWrite $error1
                        LogWrite $error2
                        LogWrite $_.Exception.Message
                        LogWrite " "

Get-DocInventory |export-csv "D:\Docs-Inventory.csv" 
  • Make sure you are using all internal names in your script. It might be different for some of the libraries where you are getting this error. Jun 9, 2016 at 13:14
  • The lists are looped through $web.Lists , I don't think there is any case of using the internal list name. Correct me if I am wrong. Jun 9, 2016 at 16:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.