Monday 19 December 2011

Sharepoint 2010 - Change Library URL

There are times when we need to change the URL for a list or library. In order to do this you need to use Sharepoint Designer. Open the Site where the document library or list is located and then choose All Files.



Select the library or list, right click and choose to Rename.



Type in the new name which will make up the new URL. This causes the Library or List URL and Name to change while the items in it remain unchanged. There is one more bit of housekeeping needed and that is to update the Quick Launch URL to the new URL.



Thursday 15 December 2011

Open PDF in Browser Not Working

In Sharepoint 2010 you can change the Web Application settings so PDFs open in the browser. You can do this in Central Admin, Manage Web Applications. Select the Application and then click on General Settings. In the Browser File Handling section you can change the settings to be Permissive.
























Once this change is made it should work but you may still have a problem with sites that have been created from a template. You can run this script to update these sites to Permissive which will then fix all of the remaining sites.

$site = Get-SPSite(“http://siteurl")
foreach ($web in $site.AllWebs) {
    Write-Host "Inspecting " $web.Title
    foreach ($list in $web.Lists) {
        if($list.browserfilehandling -eq "Strict") {
            Write-Host "Changing " $list.Title
            $list.browserfilehandling = "Permissive";
            $list.update();
            $site.url,
            $list.title,
            $list.browserfilehandling
        }
    }
}
 
 
 

Wednesday 14 December 2011

The user does not exist or is not unique

One of the web front end servers in our farm was throwing an error when users were being added to a Sharepoint group. The error displayed was the rather generic User does not exist message so I went sniffing in the logs.



Using the Correlation ID I found what was causing the exception,

An exception occurred in AD claim provider when calling 
SPClaimProvider.FillResolveClaim(): Requested registry access 
is not allowed.
 
A search on this error led me to Bernardo's excellent blog on the problem. I followed his steps and found that my app pool account was indeed being refused access to the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\
Web Server Extensions\14.0\Secure
 
I added the App Pool account to the WSS_Restricted_WPG_V4 instead of the local admin group on that server, it worked fine and resolved the issue.



Tuesday 13 December 2011

Crawl Status Paused for External Request

There is a known issue with the Symantec Backup of Sharepoint 2010 foundation which causes the search crawl to be paused but does not resume it. Read about it.
Rather than manually restarting the crawls I wrote a quick script to do it instead.

Add-PSSnapin Microsoft.SharePoint.PowerShell
$searchapp = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$searchapp.resume()

Now the crawler is restarted every night after the backup and I no longer have to remember to do it in the morning.


Monday 12 December 2011

Remove Renamed Application Database

After cleaning up a few of the non friendly Database names that SharePoint installs I noticed that they were still being referenced.
In Central Admin -> Manage Database Upgrade Status you see that the removed databases are still listed and their status is Not Responding.





You can remove them using Powershell using the following command

Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach {$_.Delete()}


Sharepoint 2010 - Discussion Boards stopped working

I hit an interest problem recently when users started getting errors when they tried to add items to Discussion boards that had been working previously. The error message they were getting was a fairly generic message informing them that the list does not exist.




















I grabbed the list guid from the url in the Sharepoint logs that matched this Correlation ID, a
SELECT * FROM AllLists WHERE tp_ID = 'AAFC8333-CC4B-4A4A-83D9-CE14AE17EE76'
promptly brought back the details of a list which proved that it did in fact exist.
I did a bit more digging but didn't get very far so I hit google but did not find much help there. Eventually after googling obscure errors in the Sharepoint Logs I came across this page which talked about how a previous CU had caused their Discussion Boards to break. They had troubleshooted the problem with Microsoft who provided this script:


UPDATE awp SET awp.tp_ContentTypeId=0x0, awp.tp_BaseViewID=0
FROM AllWebParts as awp
JOIN AllLists as al
ON awp.tp_ListId=al.tp_Id
WHERE al.tp_FeatureId='00BFEA71-6A49-43FA-B535-D15C05500108'
AND al.tp_ServerTemplate=108
AND awp.tp_BaseViewID=3
AND awp.tp_View IS NULL
GO

I ran the script on my testing box and it fixed the problem, I then ran it on my production DB and "jobs a good un"!!