Posts

Showing posts from 2014

The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.

After some searching, I will fix the issue: ·          Backup database of Managed Metadata service ·          Delete the existing Managed Metadata service application (without deleting the database) ·          Create a new Managed Metadata service application with new database ·          Edit the properties of the new Managed Metadata service application, point to the original database (if new managed metadata service is not working) ·          Iisreset (if needed)

Successfully launched “PROVIDER HOSTED APP” in MICROSOFT OFFICE STORE

I have successfully completed and deployed "Provider Hosted App" in Office Store. My App available in the Office store now HAPPPPPPPPPPPPPPPPPPPPPPPPPYYYYYYYYYYYYYYYYYYYY

Adding HTML page Content into SharePoint Page(.aspx) / Showing HTML content in SharePoint page(.aspx)

Requirement: Read HTML file from SharePoint document library and show it inside the SharePoint page (.aspx)(Read all html files and show into custom webpart, Onclicking the document link it should redirect to custom page where we will display the HTML file). i tried the below code to display to HTML content inside the SharePoint page (.aspx) C# StreamReader srHTML = null ; string strHTML = string .Empty; SPFile spfile = SPContext .Current.Web.Lists.TryGetList( "Documents" ).GetItemById(45).File; srHTML = new StreamReader (spfile.OpenBinaryStream()); strHTML = srHTML.ReadToEnd(); srHTML.Close();            ltrHTMLContent.Text = strHTML; asp.net < Div style =" height : 500px">         < asp : Literal ID ="ltrHTMLContent" runat ="server"></ asp : Literal > </ Div > The above is working very perfect.  Happy coding. I hope this will helps you....

SharePoint 2013: Adding a Blog to an Existing Site (without creating a new blog site)

Image
use the below PowerShell cmdlets Enable-SPFeature -identity "BlogContent" -url  "Sitecollection URL" After enabling the feature go to “Site contents“ then you will find 3 lists named “Posts”,”Comments” and “Categories”. Then u just navigate ‘Posts’ list and click an item then u will get the blogs UI

Install WSP in SharePoint using Powershell

WSP Installation Guide To add a wsp package Add -SPSolution "<WSP full path>"  e.g.:  Add -SPSolution "C:\kannan.wsp" To install wsp package Install-SPSolution –Identity "<wsp name>" –WebApplication "<Site collection URL>" –GACDeployment  e.g.:  Install-SPSolution –Identity "kannan.wsp" –WebApplication http://servername:1000   –GACDeployment  Activate the Feature Enable-SPFeature FeatureFolderName –url “site collection URL” e.g.: Enable-SPFeature “ kannan” –url http://servername:1000 --Kannan K

Sharepoint 2013 Distributed Cache cacheHostInfo null

Today i had one problem while start the Distributed Cache in SharePoint 2013 i was getting the below error cacheHostInfo is null After that i found the below PowerShell cmdlets to resolve this issue I ran the below cmdlet to find the GUID in the ID section of the Distributed Cache Service that is causing an issue Get-SPServiceInstance after that i ran the below cmdlet $s = get-spserviceinstance  f40a881c-buc2-4e8b-a846-172fd835e785 $s.delete() before do this make sure that "AppFabric Caching Service" service should be disabled

SHAREPOINT 2013 – DISTRIBUTED CACHE AND NEWSFEED QUESTIONS & ANSWERS

Can the cache be interrogated to obtain names of users that have posted and details of data? The cache cannot be interrogated to obtain names of users that have posted and other details of the data. Are one Distributed Cache hosts the main one and the other a standby or do both serve feeds? Both the Distributed Cache Servers serve feeds. It is for load balancing purpose and not for high-availability. What happens if one host goes down or is rebooted without warning? Will I lose feeds? The feeds will not be lost, they are stored in the database. Is this issue due to using dedicated mode opposed to collocated? When a new post is created, the content of that post is added to a profile property called  SPS-StatusNotes  to the Microfeed list on the user’s Mysite and then to the Distributed Cache. What is the best way to view new posts successfully added? Use SQL Profiler trace which reveals that SharePoint updates the  SPS-StatusNotes  property using a Stored Procedure called  dbo.pro

How are NewsFeeds Created and Stored in Sharepoint 2013

How are NewsFeeds Created and Stored in Sharepoint 2013 In SharePoint Server 2013, the newsfeed (or just simply the feed) displays activity information to users. Users access the feeds from a user's My Site. In SharePoint Server 2013, a user's My Site has several feeds available from which to choose. These different feeds show different views of activity information by filtering or pivoting on activity metadata. The different feeds available to users from their My Sites include the following: Newsfeed     Everyone     Activities     Mentions     Likes     How are Feeds Created -   All Activities are written to the Distributed Cache.The microblog features and feeds rely on the Distributed Cache to store data for very fast retrieval across all entities. Feeds mainly Rely on the following two Caches from Distributed Cache service. " Feed Cache"  that Stores recent activities and recent conversations for all entities " Last Modified Time Cache"

Programmatically LIKE and UNLIKE a SharePoint List Item

Before do this, Ensure "Likes" is enabled in " Rating Settings " under " List Settings " There are two ways to like and Unlike an Item 1. Reputation Class Reputation.SetLike(ListID,ItemID,true); If you want to unlike an item u need to write the below code Reputation.SetLike(ListID,ItemID,false); 2. Directly updating the List fields SPFieldUserValueCollection likedBy = new SPFieldUserValueCollection(web, item["LikedBy"].ToString());  SPUser user = web.EnsureUser("UserName"); SPFieldUserValue newUser = new SPFieldUserValue(web, user.ID, user.Name);  likedBy.Add(newUser); int likes = likedBy.Distinct().Count(); item["LikesCount"] = likes; item["LikedBy"] = likedBy; item.SystemUpdate(false);

SharePoint Search Index/Partition Degraded

Image
Today i had received the below error while searching. Its says that Search is not working. Then i ran the below command in PowerShell Get-SPEnterpriseSearchStatus  it tells that the index component and partition is degraded.  After that i did the below things Index Reset and Full Crawl Thanks happy troubleshooting!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Kannan K

Get Current SharePoint Site Url using javascript

<script> var clientContext; var website; function GetSiteUrl()   {    clientContext = SP.ClientContext.get_current();    website = clientContext.get_web();    clientContext.load(website);     clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);   } function onRequestSucceeded() { alert(website.get_url()); } function onRequestFailed(sender, args) { alert('Error: ' + args.get_message()); } </script> <a href='javascript:GetSiteUrl();'>Get URL</a>

Deactivating Mobile View of SharePoint 2013

http://academy.bindtuning.com/deactivate-sharepoint-2013-mobile-view/

Create new web application using PowerShell

New-SPWebApplication -Name "Name Of the WebApplication" -ApplicationPool "Name of the Application Pool" -AuthenticationMethod "NTLM" -ApplicationPoolAccount (Get-SPManagedAccount "DOMAIN\UserName") -Port 777 -URL "Url of the Webapplication"

INTRODUCTION TO CLIENT-SIDE RENDERING IN SHAREPOINT 2013

http://www.rbradbrook.co.uk/blog/2013/04/14/introduction-to-client-side-rendering-in-sharepoint-2013/

This content database has a schema version which is not supported in this farm

Image
 Today i have faced one issue while mount content database to server. the issue is " This content database has a schema version which is not supported in this farm." I was getting this error when i ran Mount-SPContentDatabase using powershell.  I tried checking SP versions and other things finally got solution in below way Reason: Once you have taken the backup from SharePoint 2013 content database, usually you will restore the database in the target SQL server. After restoring the database, you will try to restore content database in any one of Webapplication most probably new one. In this stage, you will get the above error message. Solution: Your source SQL server schema and the destination SQL server schema might not be matched. So you need to update the "Versions" table values in the "Restored Database". 1. Open " Versions " table from any of the existing "Content database"  from the Target SQL Server machine in "

Download or Get all solution packages from SharePoint Central Admin

(Get-SPFarm).Solutions | ForEach-Object{$var = "C:\Wsps" + "\" + $_.Name;$_.SolutionFile.SaveAs($var)}

How to Add new content type to SharePoint Document Library using Powershell

$site = Get-SPSite SiteURL foreach($web in $site.AllWebs){  $listCounter = $web.Lists.Count  for($i=0;$i -le $listCounter;$i++) {  $list = $web.Lists[$i]      if($list.BaseType -eq "DocumentLibrary") {      $newList = $web.Lists.item($list.ID);         $newList.ContentTypesEnabled = $true         $newList.Update()             #Add site content types to the list         $ctToAdd = $site.RootWeb.ContentTypes["New Excel"]         $ct = $newList.ContentTypes.Add($ctToAdd)         write-host "Content type" $ct.Name "added to list" $newList.Title         $ctToAdd = $site.RootWeb.ContentTypes["New PowerPoint"]         $ct = $newList.ContentTypes.Add($ctToAdd)         write-host "Content type" $ct.Name "added to list" $newList.Title         $newList.Update()  }  }  $web.Dispose();      } $site.Dispose();

Enable versions in SharePoint Library using PowerShell

$site = get-spsite("SiteURL") foreach($web in $site.AllWebs) {  Write-Host "Inspecting " $web.Title  foreach ($list in $web.Lists) {  if($list.BaseType -eq "DocumentLibrary") {  $list.EnableVersioning = $true  $list.MajorVersionLimit = 5  $list.Update()  }  } }

Feature Stapling in Sharepoint 2010 & 2013

Image
Feature Stapling  is a concept using which a specific feature will be stapled to site template Scenario I want a custom list to be deleted by default whenever a site is provisioned using the Team Site template. The best way to do this is to create a Feature Stapling. Steps to create  1. Create an Empty SharePoint project 2. Create a new Feature1 3. Add feature event receiver 4. Create a Empty element named "FeatureAssociation" [ add new item] and link the Feature1 by using feature id 5. Create a one more feature to stable this feature name Feature 2. Scope of the Feature is "Web Application" Deploy the solution and go to Central admin and select manage site features and activate our feature1[Name of the feature : Feature Stabler] Now you will create new site collection by using Teamsite template and go to viewall site contents.

Deprecated Features in SharePoint 2013 From SharePoint 2010

Features deprecated in SharePoint 2013 Preview The following features and functionality have been deprecated or changed in SharePoint 2013. Visual upgrade The visual upgrade feature in SharePoint Server 2010 is not available in SharePoint 2013. This allowed site collection owners and site owners to update customizations to work in the new user interface. Once the database and site collection upgrade was complete, the user had the option to upgrade the user interface on a more granular level of the website.  Reasons for removing this feature:  The visual upgrade feature is replaced with a deferred site collection upgrade. The site collection upgrade process is not reversible. The deferred site collection upgrade is a more comprehensive upgrade process than visual upgrade. Visual upgrade preserved only the old master pages, CSS files, and HTML files. Deferred site collection upgrade preserves much more, including SPFeature functionality. To do the deferred site collection upgrade, major

Ghostable and GhostableInLibraqry and UnGhostable ?

When a site is provisioned SharePoint doesn't really copy the pages for that site (i.e. default.aspx,setting.aspx,viewlsts.aspx) into a new database table or directory. These files exist only once on each of the front end web servers(12hive/14hive). Instead SharePoint, creates a reference to those files in the database tables that define the new site. This is called "ghosting".which improves the performance of a site.i.e ghosted pages are filesystem pages. Unghosting means that pages which are present in a database and supported the customization. GhostableInLibrary however specifies that the file be cached as part of a list whose base type is Document Library and that you can work with the file as you would with any other file in the library (check-in, check-out, version history)

SharePoint 2013 and Search with REST API and ODATA

http://www.codetails.com/2013/01/29/sharepoint-2013-and-search-with-rest-api-and-odata/

Chrome Control (Navigation Control) on the Provider Hosted Application to go back to SharePoint Site

Today i have faced one issue. I have submitted my app into microsoft app store unfortunately my app has got rejected due to some reasons. I would like to share one of those reasons here. "Users to navigate back to SharePoint via chrome controls or something similar" the below script needs to be pasted in the starting page of the app. < script src ="../Scripts/msajaxscript.js" type ="text/javascript">     </ script >     < script type ="text/javascript" src ="../Scripts/jquery-1.7.2.min.js">     </ script >     < script type ="text/javascript">         var hostweburl;         // Load the SharePoint resources.         $(document).ready( function () {             // Get the URI decoded app web URL.             hostweburl =                 decodeURIComponent(                     getQueryStringParameter( "SPHostUrl" )             );             //