Tuesday, 3 March 2015

Sharepoint 2010 error opening .pdf files




When you try to open a PDF document from your standard SharePoint library, as it tries to open it in Acrobat viewer and you encounter the error:

There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.

You can fix it read below:

DON'T


  • Change Client Integration
  • Change File handling methods

DO

Go to the following Path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML

Edit the DOCICON.XML file 

Find this entry

<Mapping Key="pdf" Value="icpdf.png" OpenControl="PdfFile.OpenDocuments"/>




and edit it to 

<Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>





Hope this fixes your problem


Tuesday, 3 February 2015

Using the Developer Dashboard

How to Enable the Developer Dashboard

The Developer Dashboard is always off by default. To make it viewable, you must enable it, by using STSADM, Windows PowerShell cmdlets, or the SharePoint Foundation object model.

Using STSADM
Open a command window to the %ProgramFiles%\Common Files\Microsoft Shared Debug\Web Server Extensions\14\BIN directory and enter one of the following commands, depending on the desired display mode.

Mode (Always On)
stsadm -o setproperty -pn developer-dashboard -pv on

OnDemand
stsadm -o setproperty -pn developer-dashboard -pv ondemand


Using Windows PowerShell Cmdlets
Mode (Always On)
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”On”

OnDemand
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”OnDemand”


How to Disable the Developer Dashboard

Using STSADM
stsadm -o setproperty -pn developer-dashboard -pv off


Thursday, 8 January 2015

SharePoint 2010: Site Web Analytics Reports Issue/Error

ISSUE:

You are trying to access “Site Web Analytics Reports” on your site using the below URL

http://<Your_Site_URL>/_layouts/UsageDetails.aspx

But everytime, you try to access the report, you are getting error message, which is mentioned below:

Unexpected failure.

 Troubleshooting Microsoft SharePoint Foundation.

 Correlation ID: 1e9c-4f07-0eb920fa-9311-b353aa6eac13

 Date and Time: 08/15/2012 13:08:05 


RESEARCH:

I checked and found that we can access the report by directly accessing the URL mentioned below
http://<Your_site_URL>/_layouts/WebAnalytics/Report.aspx?t=SummaryReport&l=s

When i browse the above url, i get below message:

This report displays all available metrics Web Analytics for the specified date range, and the tendency to change the date range above. This requires that the new SharePoint user experience is on. A site owner or administrator can enable the new experience from the Site Actions menu option or from the title, description and appearance of Site Settings.

RESOLUTION:

This is the new feature made available in SharePoint 2010, hence the Visual upgrade of site is a must to work this. Which means the current look n feel of 2007 need to be upgrade to 2010. Once this is performed the site display will change many things and remove any kind of custom work on the site.


Tuesday, 2 December 2014

Create and configure the View Web Analytics Data permission

After the Web Analytics service application is configured, the View Web Analytics Data permission needs to be created for users that are not a site collection administrator or site owner. This is the minimum required permission needed to view Web Analytics reports. End users who need to access a Web Analytics report must have this permission assigned to them.

To create the View Web Analytics Data permission for a site or site collection

  • Verify that the user account that is performing this procedure is that of a site collection administrator or a site owner.
  • From a site or site collection, click Site Permissions from the Site Actions menu.
  • On Site Permissions page, on the Edit tab, in the Manage group, click Permission Levels.
  • Click Add a Permission Level.
  • In the Name field, type View Web Analytics Data.
  • In the Permissions section, under the List Permissions, select the View Application Pages check box.
  • In the Permissions section, under the Site Permissions, select the View Web Analytics Data and Enumerate Permissions check boxes.
  • Click Create.



To configure the View Web Analytics Data permission for a site or site collection

  • Verify that the user account that is performing this procedure is that of a site collection administrator or a site owner.
  • From a site or site collection, click Site Permissions from the Site Actions menu.
  • On the Site Permissions page, on the Edit tab, in the Grant group, click Grant Permissions.
  • In the Users/Groups box, add the users that will be granted the View Web Analytics Data permission.
  • In the Grant Permissions section, click Grant users permission directly, and then select the View Web Analytics Data check box.
  • Click OK.



Wednesday, 19 November 2014

Solution for Zero Byte SharePoint 2010 Log files

If your SharePoint 2010 Log files are of  zero byte i.e. SharePoint is unable to record the Log information then perform the following steps to resolve it

Make sure the login account of “Windows SharePoint Services Tracing V4” is member of Local Administrators group.

Make sure you have restarted the “Windows SharePoint Services Tracing V4” service after performing step 1.


Wednesday, 12 November 2014

SharePoint: Health Analyzer: Databases require upgrade or not supported

Situation, the health analyzer points out there is a problem with the SharePoint environment:“Databases require upgrade or not supported” is the message received.

Clicking on the link within the error message will get show the details of the problem encountered.
The image below gives us an idea, it shows that the problem is the version of the database and the remedy is running the Upgrade-SPContentDatabase cmdlet (i.e. PowerShell script) or running the PSConfig.exe for all other types of databases.


In the remedy section there is a link, this link references the general SharePoint products page. It is not very helpful to remedy the error. The text below will explain how to upgrade the content databases and how to upgrade all other databases.

Finding the databases that need upgrading.
Opening “Central Administration”.
Click “Upgrade and Migration”
Click “Review Database Status”
The administration will show a screen with all the Sql Server Instances, the database names, the type of the database and their status. The Status will show whether or not an upgrade is required.


Upgrading content databases require the GUID of the database that is linked to the site-collection. The site-collection is the key with which we can find the GUID of the database. The name of the content database should supply a clue.


In the case used for this example the content database that was serving the Central Administration Site needed an upgrade. To make sure validating the assumption is always a good idea.

Validating the connection between the content database and the site collection.
In the Central administration –> “Application Management”
Under “Databases” –> “Manage content databases”
Select the Web Application which you think is linked to the content database that needs upgrading.


If the content database shows up under the Database Name, the content database and the web application are validated to have a relation with each other.

Upgrading Content databases using SharePoint 2010 Management Shell
Start the “SharePoint 2010 Management Shell”
In the Shell enter : Get-SPContentDatabase –site [url towards your site collection]


The yellow marked text shows the GUID of the content database.

Cut and paste the GUID to the following command:Upgrade-SPContentDatabase [guid]


It will take some time before the 100% appears.

Upgrading ‘all other’ type of databases using psconfig.exe
Open a command box in ‘run as administrator’ mode.
Navigate to the bin directory of the SharePoint root. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
Run the following command: PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
The PSConfig.exe tool will go though several steps to upgrade all the databases in the correct sequence.

Validate that all the databases where updated successfully.

Open “Central Administration”.
Click “Upgrade and Migration”
Click “Review Database Status”
When the process is complete all of the databases should say ‘no action required’

Thursday, 6 November 2014

Blob Cache in SharePoint

1. What is Blob Cache?

Disk-based Caching for Binary Large Objects
Disk-based caching controls caching for binary large objects (BLOBs) such as image, sound, and video files, as well as code fragments. Disk-based caching is extremely fast and eliminates the need for database round trips. BLOBs are retrieved from the database once and stored on the Web client. Further requests are served from the cache and trimmed based on security.


2. Enabling and modifying disk-based caching for SharePoint sites.

Disk-based caching is disabled by default. To enable and customize the disk-based cache, you must modify the following statement in the web.config file for the SharePoint Web application.
By default, it looks like this:
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="false" />
In order to improve the performance of your site, the BlobCache should be enabled.
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="true" />
Example:
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" max-age="86400" enabled="false"/>
In the preceding example:
• location is the directory where the cached files will be stored
• path specifies in the form of a regular expression which files are cached based on the file extension
• maxSize is the maximum allowable size of the disk-based cache in gigabytes
• max-age specifies the maximum amount of time in seconds that the client browser caches BLOBs downloaded to the client computer. If the downloaded items have not expired since the last download, the same items are not re-requested when the page is requested. The max-age attribute is set by default to 86400 seconds (that is, 24 hours), but it can be set to a time period of 0 or greater.
• enabled is a Boolean that disables or enables the cache.


3. Flushing the Disk-based Cache:

We can flush the current site collection object cache. To do this, browse to the following location on the web site,
Site collection administration -> site collection object cache -> disk based cache reset.
If we have multiple WFEs in the farm, each WFE will maintain its own copy of Disk-based Cache. SharePoint does not have a Web user interface (UI) to flush the disk-based cache on all the servers in a farm and neither is there an option to select a specific WFE.
4.The option provided in the Administration page for flushing the cache is only to the flush the cache on the web front end to which you are currently browsing.
if you would like to flush the complete binary large object (BLOB) caches associated with a specific Web Application on different Web front-end computers in a farm, then you can use the STSADM command to do so.
STSADM -o setproperty -propertyname blobcacheflushcount -propertyvalue 11 -url http://web:port 


5. Internals of the blob cache functionality within SharePoint:

After enabling blob cache in web.config, do an IISRESET and browse to the /settings.aspx first, instead of home page (Collaboration portal site).
When we browse to the settings.aspx, it will create the following files change.bin, dump.bin and flushcount.bin (all the files will be 1KB in size).
Browse to the home page now, it will create a folder PUBLISHINGIMAGES, all the images rendered from the database will be stored here and the above bin files will also get updated (we can see the difference in file size).
Every time when a new image file is rendered from the database, the image folder gets a copy of the image. The bin files (index) will get updated with an additional entry for the new file.
Every request from client will check the index file first. It will only check the cache index and not the image folder directly for the image. If the index file does not have an entry for the image, then the request is served from the database. During this time, a copy of the image will be stored in the images folder and the index file also gets updated, so that the next request will not go to the database.


6. What happens I manually delete just the image file in the cache folder or the image file in the cache folder gets corrupted?

We will not see the image on the client page; we get a broken image ‘X’.


7. How are these cache files stored?

Filename.extension.cache is the file naming format.


8. What can I do if the cached file gets corrupted?

Recommendation: We can reset the index file. Site settings -> Site collection object cache -> Check the box for “Force this server to reset its disk based cache”. It will completely delete all the images and reset the bin files back to 1KB, so that next request will go to database and the complete index will get rebuilt.
Workaround: If you do not want to reset the complete index. Find out the missing image and copy just that file to the cache folder, name it as “filename.extension.cache”
Refresh the page now; it should pick up the image.


9. How is the Index file maintained?

Every time when the web.config initializes, the index file is loaded from the blobcache folder to memory. All new entries will keep getting updated in index file when in memory.
IISRESET /stop will flush the updated index file from memory to disc within the blobcache folder.
IISRESET /start will load the index file from blobcache folder to memory.
As long as the application pool is alive the index file will be getting updated in memory itself.


10. Can an Index file get corrupt?

Index file corruption is possible only when IIS crash or the index file is overwritten with wrong information. When IIS tries to load the index file from blobcache to memory and identifies that it is a corrupted file (not a valid file), it will get completely rebuilt (flush) as fresh file (1KB), all the old entries and images will be lost.


11. In a farm environment, is there any way of having all the WFEs' blob caches synchronized among each other?

No, this cannot be done because SharePoint maintains the index and the cache files individually on each server.


12. In a single WFE environment using web gardening, how does blob caching function? Is there any sync that happens among the working processes?

Web gardening is not supported.


13. What would be the best way of using blob cache in a farm environment (best practices)?


If the requirement is to “centralize” static cached files, then 3rd party content distribution network (CDN) solutions like Akamai need to be used.
What are the limitations of SharePoint and blob caching in a farm environment?
a. Blob caching does not work with Web Gardening.
b. Blob caching does not synchronize data across WFEs – so we might be seeing different versions of the files for a short duration across different WFE servers.