Share via


PowerShell : SharePoint 2010 Missing Required Fields in List

PowerShell : SharePoint 2010 Missing Required Fields in List

Requirement

Need a CSV report of SharePoint list which has missing required fields.

Background

SharePoint will not allow to save the List item if required fields are missed. So, the report will have no values. We removed mandatory field due to business requirement and reverted. During this interval few users updated List items.Now we need to identify and fill those List items. Quick Fix You can export the List Item to Excel [Refer Ribbon] and use filter. If it's not Document Library you can use Power Query in Excel. Much faster for huge list items.

PowerShell Code

$web = Get-SPWeb 'http://site.com/subsite'
$list = $web.Lists["ListName"]
$data = $list.Items | ? {$_.MissingRequiredFields -eq $true}
$data | Select Title , MissingRequiredFields , ID | 
Export-Csv C:\Temp\SPListMissing.csv -NoTypeInformation -Encoding UTF8

Enjoy PowerShell :)