For some reason, a number of Document Libraries on a Farm I recently upgraded to SharePoint 2013 lost their default view.
Using SharePoint Designer I can see the allitems.aspx available in the library files, however, it wasn’t available as a view in the library settings.
Linking direct to allitems.aspx worked, however, clicking directly on the Document Library produces this error message:
To view your documents, please navigate to the library and select the ‘Open with Explorer’ action. If the ‘Open with Explorer’ action is not available, then your system may not support it.
The issue also caused a problem with a 3rd party add on for Outlook (MacroView) that did not show the Library in the tree view because it had no default view.
Using PowerShell we can return a list of Libraries in a Site Collection that has no default view.
We can then set a new default view or create a new one.
$Site = Get-SPSite http://Intranet/ $Webs = $Site.AllWebs foreach($Web in $Webs) { foreach($List in $Web.Lists) { if($List.BaseTemplate -eq "DocumentLibrary") { if(!$List.DefaultView) { Write-Host "Web: " $Web.Title " - Library: " $List.Title } } } }