Pages

Sep 3, 2012

SharePoint, jpg and gif files won't display throwing Cannot Complete this action...

Issue:

jpg and gif files will not display on pages. Also, I can type the url to the image:

http://site/portal%20pictures/image.gif
http://site/portal%20pictures/image.jpg

I get "Error  - Cannot complete this action" page.


Resolution:


This issue may be related to Blobcache. Did you enable blobcache? If so, please try to reset 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 be getting rebuilt.

If you do not want to reset the complete index, find out the missing image and copy to the image folder. Name it as "filename.JPG.cache” and refresh the page. This should pick up the image.

On Blobcache follow the below blog......

Sep 1, 2012

SharePoint Welcome Page Redirection To other Site collection or Web application!!!


Scenario: You have several SharePoint web-applications (only site collections). Whenever a user opens one of those using just an entry-URL (such as http://pravyns) you want to redirect to another site collection (not necessarily in the same web-application - for example to http://pravyns/site .

1. Go to the web you want to create the redirect.
2. If it is a publishing web, go to the "Pages" library, otherwise, you can use any other library that is of type "Document Library"
3. Go to the "List Settings"
4. Ensure that under "Advanced Settings" "Allow management of content types" is set to "yes"
5. In the "Content Types" section click on "Add from existing site content types"
6. Add the "Link to a Document" content type
7. Your content types list should now include the "Link to a Documet" content type:
8. Back on the list with its items, create a new item of type "Link to Document":
9. Don't forget to publish your link if you have a publishing/approval process setup for your library! 
10. Now go to the "Site Settings" of your web and choose in "Look'n'Feel" section "Welcome Page":

Enter your link as the welcome page of this web. 

Aug 29, 2012


Access Denied Error while creating new article page in SharePoint MOSS 2007

List does not exist
The page you selected contains a list that does not exist. 
It may have been deleted by another user.
But this user can do everything else except the Create Page from the Site Action drop down. From the URL, you can see the Create Page is using /_layouts/CreatePage.aspx file which I believe is using publishing template
Resolutions Steps:
  •  Go to Site Setting –> Modify All Site Settings from the Site Action drop down.
  •  Select Master pages and Page layoutsfrom the Galleries section.
  • From the Master Page Gallery document library, select Document Library Settings from the Setting drop down.
  • And select Permissions for this document library option, and double check the permission setting. To be simplified, just inherit all permissions from the parent site. Then the user with full control permission will be able to create article page there.

          There you go!!!

Aug 28, 2012

Add Users and Site Permissions Error – Object reference not set to an instance of an object


While performing some testing as part of my current SharePoint 2007 migration project, I encountered the following error when accessing the Add Users link from People and Groups:
Object reference not set to an instance of an object.   at Microsoft.SharePoint.SPRoleDefinitionCollection.Init()
   at Microsoft.SharePoint.SPRoleDefinitionCollection.Undirty()
   at Microsoft.SharePoint.SPBaseCollection.System.Collections.IEnumerable.GetEnumerator()
   at Microsoft.SharePoint.ApplicationPages.AclInv.InitPage()
   at Microsoft.SharePoint.ApplicationPages.CBaseAclPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I also received the same error message when going to the Site Permissions page of the same site. Going to either screen in other sites in the same site collection did not have this issue so at least it wasn’t a wide spread problem.
A quick search returned this forum post of someone encountering the same issue along with some responses indicating this was a mismatch between the Roles and Groups tables in the database. I didn’t want to edit the database directly as this would take the installation into an unsupported state and was about to continue searching when I saw in the last forum response that re-inheriting the site permissions also fixed this issue.
Along with the information about there being missing information in the database led me to the conclusion that something on those two pages was missing (a user or permission group perhaps) but this hadn’t be registered in the database properly. But how can I get to the re-inherit permissions screen if I can’t get to the Site Permissions page in the first place?
I contemplated digging through the source to figure out where that menu link takes you but instead figured this might be something I could achieve with the object model and hence Powershell! Another quick search revealed that SPWeb.ResetRoleInheritance() was what I needed so I fired up Powershell to see if I could resolve the issue.
First off I need a reference to my site (or Web in proper terminology):
$site = New-Object Microsoft.SharePoint.SPSite("http://my.intranet.local/sites/subsite/")
$web = $site.OpenWeb()
Now I could just immediately call $web.ResetRoleInheritance() but I first wanted to see if I could see what permissions are currently assigned to the site so I can try and put them back to their original state once the permissions are re-inherited.
$web.Permissions | ft Member,PermissionMask
I’m using format-table (or the abbreviated ft rather) to show just the Member and PermissionMask columns in a nicely formatted table which gives me the following:
Member                       PermissionMask
------                       --------------
Intranet Owners              FullMask
Intranet Visitors            138612833
Site Owners                  FullMask
Site Members                 1011045712
Subsite Owners               FullMask
Subsite Members              1011045712
Subsite Visitors             138612833
So what permission levels do the PermissionMask values correspond to? I can presume that FullMask = Full Control and can take a guess that 138612833 corresponds to Read and 1011045712 corresponds to Contribute but it would be nice to confirm this.
I decided to get a list of the permission levels assigned to the site by doing the following:
$web.Roles | ft Name,PermissionMask
Which gave me the following:
Name                       PermissionMask
----                       --------------
Full Control               FullMask
Design                     1012866047
Manage Hierarchy           2129075183
Approve                    1011028991
Contribute                 1013125871
Read                       138612833
Restricted Read            196641
Limited Access             OpenWeb, BrowseUserInfo
View Only                  138612801
From this I can see that FullMask does indeed equate to Full Control and that 138612833 corresponds to Read as suspected, but interestingly 1011045712 does not exist at all. This confirmed my suspicion that a missing entry had caused the original fault – in this case it looks like a custom Permission Level may have been removed from the site. I would have thought SharePoint would handle this gracefully but perhaps not though I haven’t gotten around to confirming this yet.
At any rate, all that was left for me to do was re-inherit the permissions using the following:
$web.ResetRoleInheritance()
$web.Update()
Once this was done I could access both the Add User and Site Permissions screens successfully and was able to manually break the permission inheritance and reconfigure as required!

Apr 18, 2012

Sharepoint search results: document icon is not displayed

When it comes to documents icons we always have to check the ...\12\TEMPLATE\XML\DocIcon.xml. The problem was that the file had two instances of the pdf mapping key and the gif file name which is in the mapping value had a blank space in it. I deleted one instance, corrected the gif file name and performed an IISRESET. After that, the icons displayed fine.

Apr 9, 2012

Best Practices - BLOB Cache (Configuration & Type of files to Include)


In SharePoint you also have something called the BLOB Cache, which is a disk-based caching mechanism that caches resources on the disk. Normally these resources are files served by a web page and are named Binary Large OBjects (BLOB).
Normally the BLOB cache will cache files served by the web request like images and video clips.
In web.config you’ve got something similar to the following line which lets you know what file types are cached. You can of course add or remove file types here:
<BlobCache  
    location="D:BLOB" 
path=".(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$"
    maxSize="10" 
    enabled="false" />

Best Practices - SharePoint Anti-virus scanning exclusions!!!


Occasionally different anti-virus products can interfere with SharePoint operations. The following is a list of suggested locations to exclude from your AV scanner. Remember, this is merely a suggestion, so use at your own risk!

1.  %PROGRAM FILES%\Common Files\Microsoft Shared\web server extensions\12
2.  %WINNT%\temp
3.  %PROGRAM FILES%\Microsoft Office Server
4.  %WINNT%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
5.  Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\     (the config cache)
6.  %WINNT%\Temp\WebTempDir
UPDATE: We've released a KB that covers this.
http://support.microsoft.com/kb/952167
But is you want to SCAN uploading and downloading of documents in SharePoint, You need to configure Antivirus in Central Administration > Operations > Security Configuration and Select Antivirus.
NOTE: You can activate Antivirus measures only after installing a compatible Antivirus scanner. In a server farm, you must install Antivirus software on every Web front-end server in the server farm.

To enable Antivirus Settings section, Select one or all of the following:
  1. Scan documents on upload.
  2. Scan documents on download.
  3. Allow users to download infected documents.
  4. Attempt to clean infected documents.
  5. In the Time out scanning after ___ seconds box, type the number of seconds to allow before timing out the scanning process.

  6. NOTE: The default time is 300 seconds, or 5 minutes. This should be enough time to allow the Antivirus processes to finish without affecting performance. The default time is recommended, but you can adjust this time if you are experiencing performance issues.
  7. In the Allow scanner to use up to ___ threads box, type the number of threads to allow the scanning process to take up.

  8. NOTE: By default, the number of threads is set to 5, which should be sufficient for even a large number of sites. The default number of threads is recommended, but you can adjust the number of threads if you are experiencing performance issues.
  9. Click OK.


    NOTE: Best Practice is to No need to scan for documents which are getting download from 
    SharePoint, but please note it totally depends upon your business need.

Best Practices - Application Pools Limitation in IIS where SharePoint is Installed!!!

For SharePoint web application content, if you have more than 10 application pools on the same server (see here: http://technet.microsoft.com/en-us/library/cc262787.aspx), you are outside support. You have a choice between sharing application pools between several web applications for performance, or having some *specific* web apps in their own pool. Each time you do this it uses more CPU and RAM resources. However, a separate app pool may make my web app less vulnerable to other web apps crashing on the same server. Generally, I only have separate application pools for web apps when I have a specific security or stability requirement; e.g. my Corporate Published Intranet web app should be separate from the My Sites and Team Sites self-service-site-provisioning ones.


The above content is according to Microsoft Recommendation.

Best Practices - MAXDOP for SharePoint Databases Should be Set to "1"


Theory Says:

0 - Uses the actual number of available CPUs depending on the current system workload. This is the default value and recommended setting for Non-SharePoint SQL DBs.

1 - Suppresses parallel plan generation. The operation will be executed serially.

2-64 - Limits the number of processors to the specified value. Fewer processors may be used depending on the current workload. If a value larger than the number of available CPUs is specified, the actual number of available CPUs is used.

Mar 7, 2012

SharePoint Governance

Refer to the following blog for better understanding on SharePoint Governance.

 I've written a small series with technical focus:
http://kjellsj.blogspot.com/2010/05/sharepoint-governance-part-i-eating.html

Its also referenced on the SP governance resource center:
http://technet.microsoft.com/en-us/sharepoint/ff800826.asp

Back up and Restore your Site Collection in Sharepoint

You can use the tools included with Microsoft Office SharePoint Server 2007 to back up and restore your site collections. The Stsadm command line tool offers a fast and flexible, command line-based approach to content backup and recovery. You can use the Stsadm command-line tool together with Windows Scheduler to schedule delayed or periodic backups.
For more information about how the data protection tools included with Office SharePoint Server 2007 compare with other tools for protecting the SharePoint data, see Choose backup and recovery tools (Office SharePoint Server). 

Important:
If changes are made to the site collection during the backup process, the backup can become corrupted. Backing up large site collections can take a long time. To reduce the chance that user activity will interfere with a site collection backup, or that the time that is required to back up large site collections will exceed the available maintenance window, follow these recommendations:
• For the duration of the backup, set the site collection URL to read-only by using the Setsitelock operation in the Stsadm command-line tool. This lets users view content on the site, but prevents activities such as adding or changing content that interfere with the backup process. When the backup is complete, return the access setting of the site collection URL to its default state.
• If the size of the site collection that you want to back up is 15 gigabytes (GB) or smaller, use the Stsadm command-line tool as shown in the procedures that follow.
• If the size of the site collection that you want to back up is from 15 GB through 100 GB, use Microsoft SQL Server 2005 or Microsoft System Center Data Protection Manager 2007 to perform a full backup of the site collection database.
• If the size of the site collection that you want to back up is larger than 100 GB, use System Center Data Protection Manager to perform a differential backup of the site collection database.
For more information about backup and recovery tools, see Choose backup and recovery tools (Office SharePoint Server).

Back up a site collection by using SharePoint built-in toolsUse this procedure to restrict access to the site collection during backup by using the Stsadm command-line tool.
Important:
Membership in the Administrators group on the local computer is the minimum required to complete this procedure. Limit access to the site collection during backup1. At a command prompt on the drive on which SharePoint Products and Technologies is installed, change to the following directory:%COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
2. To determine the current access level of the site, type the following command, and then press ENTER: stsadm -o getsitelock -url <> where URL name is the URL of the site collection that you want to back up.
3. If the current access level allows changes to the site content, change it to read-only by typing the following command, and then pressing ENTER:stsadm -o setsitelock -url 
<-lock readonly where URL name is the URL of the site collection that you want to back up.
4. When the backup is complete, reset your site collection lock from read-only to none
stsadm -o setsitelock -url <-lock none

Use this procedure to back up a site collection by using the Stsadm command-line tool.

Important:
 Membership in the Administrators group on the local computer is the minimum required to complete this procedure. To back up a site collection by using the Stsadm command-line tool 1. On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
2. Type the following command: stsadm -o backup -url 
<-filename <\\server. name\folder name\file name> [-overwrite] where URL name is the URL of the site collection that you want to back up, and where \\server name\folder name\file name is the UNC path of the backup folder and the name of the file that you are backing up to. If there is an existing file for the backup, use the -overwrite parameter to overwrite the existing file.
3. If the backup is completed successfully, the Command Prompt window displays the following text: Operation completed successfully.
4. If the backup is not completed successfully, the Command Prompt window provides additional details about the failure. Most typically, an incorrect URL or file name was given.
Use this procedure to restore a Web application by using the Stsadm command-line tool.

Important: 
Membership in the Administrators group on the local computer is the minimum required to complete this procedure.
 To restore a site collection by using the Stsadm command-line tool 

1. On the drive where SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
2. To restore a site collection, type the following command, and then press Enter: 
stsadm -o restore -url 
<-directory <\\server. name\folder name\file name> -restoremethod overwrite where URL name is the URL of the site collection that you want to restore and UNC path is the UNC path of the backup shared folder.
3. When you receive a warning that all selected items will be overwritten, type y, and then press Enter.
4. When prompted, type the user name and password for the Web application and content databases.
5. If the recovery is completed successfully, the Command Prompt window displays the following text:
Operation completed successfully.
6. If the recovery is not completed successfully, the command Prompt window provides additional details about the failure.

Most typically, an incorrect URL or file name was given.

It is not possible to schedule backups from the SharePoint Central Administration Web site. There is no operation that enables you to automate backups by using the Stsadm command-line tool.

You can, however, automate the process by creating a batch file and then using Task Scheduler in Windows Server 2003 to run the batch file at a specific time. Because performance can be affected when doing backups with the Office SharePoint Server 2007 built-in tools, you might want to schedule your backups for off-peak times such as at night or on weekends.
 

Use this procedure to create a batch file that will run a full backup of your site collection. This procedure assumes that you have already created a shared folder for your backups.
Tip: When using Task Scheduler, make sure that the system date and time on your computer are accurate. To verify or change this information, double-click the time indicator on the taskbar. To create a batch file

1. Click Start, and then click Run.
2. Type notepad, and then click OK.
3. In Notepad, type the following text:
Copy Code

@echo off
echo ===============================================================
echo Back up sites for the farm to C:\backup
echo ===============================================================
cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
@echo off
stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item 
echo completed
4. where \\server name\folder name is the UNC path of the backup folder and where Web application name is the name of the site collection that you want to back up. You might use the full farm path notation as displayed by the showtree parameter or the name of the component in the path if it has a unique name — for example, Windows SharePoint Services Web Application\SharePoint-80.5. In Notepad, on the File menu, click Save As.6. In the Save As box, select the folder where you want to keep your batch file.7. Use the ".bat" file name extension; type the name of the file in the File name box, for example, backup_batch.bat.8. In the Save as type box, click All files.9. Click Save.
To schedule a backup 
1. Start the Scheduled Task Wizard, and then click Next.
 
2. Click Browse, locate the batch file that you just created, and then click Open.
 
3. Type a name for your task, for example, backup_batch.
 
4. Select how often you want this task performed (for example, weekly), and then click Next.

5. To automatically perform this backup periodically, select an interval such as Weekly or Monthly. To perform this backup one time, or to delay a single backup, select One time only.
6. Choose a time and start date for your backup.
7. Type a name and password for a user, and then click Next. This task will run as if it were started by that user. 
8. Click Finish.
To configure advanced settings for the task, select the Open advanced properties for this task when I click Finish check box in the final page of the wizard. This opens the properties dialog box for the task when you click Finish.

You can then change the program being run on the Task tab, fine-tune the schedule on the Schedule tab, customize settings on the Settings tab, or set user and group permissions on the Security tab.

Courtesy: MSDN

Mar 6, 2012

SharePoint Error: Code blocks are not allowed in this file


Problem

Users report the following error when attempting to access a document library in SharePoint.
An error occurred during the processing of /site/SharedDocuments/Forms/AllItems.aspx. Code blocks are not allowed in this file.
image

Explanation

Ever so often I have clients contact me with a SharePoint library fully corrupted reporting an error such as “Code blocks are not allowed in this file”.  The error is, in fact, limited to a specific view but it’s usually the default view, therefore the error makes the library appear like it is completely inaccessible.  The root cause of the error is simple – a user replaced a view file from the /forms/ folder of the document library, typically “AllItems.aspx” such as the screenshot below suggests.  Typically this occurs when the user is using explorer view but I’ve heard of manifest presentations of this error as well.

Solution – Option 1

1) Open site that contains the library
2) Click on “Site Actions” >> “Site Settings” to view the site settings page “_layouts/settings.aspx”
3) Click on the library that displays the error to view the library’s settings page
image
4) Add a new view to the library and check the box “default view”

Mar 5, 2012

What is the meaning of “Limited Access” in SharePoint?


SharePoint provides different levels of permissions, from the “Full Access” to “Limited Access”. Last one is not documented clearly and designed to cover some side-effects of item’s hierarchy.
Cite from “Permission levels and permissions” article:
The Limited Access permission level is designed to be combined with fine-grained permissions to give users access to a specific list, document library, item, or document, without giving them access to the entire site. However, to access a list or library, for example, a user must have permission to open the parent Web site and read shared data such as the theme and navigation bars of the Web site. The Limited Access permission level cannot be customized or deleted
"Limited Access" allows no direct access to site content at all, but is intended to allow users to traverse the site in order to access the items within it that they have explicit permissions to see.
For example, the user might have access only to one page of a site, but still need access to style sheets and other supporting site infrastructure in order to view it. In that case the user would need "Limited Access" permissions on the site and "Restricted Access" to the page.

One solution which i feel useful but I haven’t used in any of my project can be found on codeplex here:http://www.codeplex.com/SPLimitedAccessDisco
So you guys can try out..........................!

WCF Issue related to KB976769v2

Today we have seen a strange issue in consuming WCF service for our user control. The following error have been came up after turning off the Custom Errors in Web.Config file of SharePoint Web application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: An error occurred creating the configuration section handler for system.serviceModel/bindings: Could not load type 'System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement' from assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Source Error: 
Line 131:  </behaviors>
Line 132:
Line 133:  <bindings>
Line 134:   <wsHttpBinding>
Line 135:    <binding name="MyWSHttpBinding" maxReceivedMessageSize="2147483647">
My Environment Details:
  • SharePoint 2007
  • Windows Server 2003
Solution

After removing KB976769v2 from "Add-Remove programs" from control panel in all my web-servers fixed the problem.

Mar 1, 2012

Access denied error while Editing List Items in SharePoint(MOSS 2007)

Sometimes, we get access denied error while editing (Edit properties) the list item even though we have access to the Sharepoint list.
Also, View History link on the Sharepoint list item throws access denied issue

Solution
This is a issue with Sharepoint and we need to execute the code to the SP libraries or lists to fix the problem. The source code for this app is as follows. Put this in a console app and pass the site URL and list name as parameters.
This is working code and solved our production issue.

string RenderXMLPattenAttribute = "RenderXMLUsingPattern";
string weburl = "http://Pravyns/sites/Test/";
string listName = "Test Library";
SPSite site = new SPSite(weburl);
SPWeb web = site.OpenWeb();
Console.WriteLine(web.Name);
SPList list = web.Lists[listName];
SPField f = list.Fields.GetFieldByInternalName("PermMask");
string s = f.SchemaXml;
Console.WriteLine("schemaXml before: " + s);
XmlDocument xd = new XmlDocument();
xd.LoadXml(s);
XmlElement xe = xd.DocumentElement;
if (xe.Attributes[RenderXMLPattenAttribute] == null)
{
XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute);
attr.Value = "TRUE";
xe.Attributes.Append(attr);
}
string strXml = xe.OuterXml;
Console.WriteLine("schemaXml after: " + strXml);
f.SchemaXml = strXml;
Console.WriteLine("Process completed");
Console.ReadLine();

Feb 24, 2012

Microsoft SharePoint 15: A 2012 release target date.....

Here you go...........

http://www.zdnet.com/blog/microsoft/microsoft-sharepoint-15-a-2012-release-target-an-app-marketplace-and-more/12002

Feb 11, 2012

Where is Praveen?

Its been long to write entry here. Feeling good after moving to JDA, Hyderbad. Hoping to write more articles this year.