Wednesday, 12 November 2014

How to enable Developer Dashboard in SharePoint

#add snnapin if not


if((Get-PSSnapin Microsoft.SharePoint.Powershell) -eq $null)
{
    Add-Pssnapin Microsoft.SharePoint.Powershell
}


#enable developer dashboard SpDeveloperDashboardLevel = On


$services = [Microsoft.SharePoint.Administration.Spwebservice]::ContentService
$addsettings = $services.DeveloperDashboardSetting
$addsettings.DisplayLevel = [Microsoft.SharePoint.Administration.SpDeveloperDashboardLevel]::On
$addsettings.Update()

Monday, 10 November 2014

Number of item in List in SharePoint Site throughout web application

Introduction

Number of item in SharePoint list through out web application

Building the Sample

Script need to run where SharePoint Server is installed
Description
Get Spwepapplication =>spsite =>spweb =>webs
Then get all list in webs and get the count of item in lsit
$listitem = $List.Item.Count
 Please find below code for finding list item in all list in Web Application


#parameter declaration
param
(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [System.String] $WebAppUrl,
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [System.String] $OutputFilePath
)
#check and add snappin
$snapin = Get-PSSnapin | Where-Object {
$_.Name -eq "Microsoft.SharePoint.Powershell"
}
if($snapin -eq $null){
Write-Host "Loading SharePoint Powershell Snnapin......."
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
#Creating table according to column values required
$startTime = Get-Date
Write-Host Script Starting time at $startTime -ForegroundColor Red
$table = New-Object system.Data.DataTable "Orphan Objects"
$WebTitle = New-Object system.Data.DataColumn WebTitle,([string])
$WebUrl = New-Object system.Data.DataColumn WebUrl,([string])
$ListTitle = New-Object system.Data.DataColumn ListTitle, ([String])
$ListUrl = New-Object system.Data.DataColumn ListUrl, ([String])
$ListItemCount = New-Object system.Data.DataColumn ListItemCount, ([String])
$table.columns.add($WebTitle)
$table.columns.add($WebUrl)
$table.columns.add($ListTitle)
$table.columns.add($ListUrl)
$table.columns.add($ListItemCount)
#iterating webapplication => spsite=> spweb=>web =>List
$allWebs = Get-SPWebApplication $WebAppUrl | Get-SPSite -Limit All | Get-SPWeb -Limit All
Foreach($webs in $allWebs)
{
foreach($List in  $webs.Lists)
{
$ListItemCount = $List.Items.Count
if($ListItemCount -gt 5000)
{
#write result to command prompt
 Write-Host List named $List.Title  has $ListItemCount records at $webs.Title -ForegroundColor Green
#write result to table
 $row = $table.NewRow()
           $row.WebTitle = $webs.Title
     $row.WebUrl = $webs.Url
     $row.ListTitle = $List.Title
     $row.ListUrl = $List.RootFolder.Url
     $row.ListItemCount = $ListItemCount
        $table.Rows.Add($row)
           $table.AcceptChanges()
}
}
}
$endTime = Get-Date
Write-Host Script Ending time at $endTime -ForegroundColor Red
#exporting data table to file
$table | Select-Object WebTitle, WebUrl, ListTitle, ListUrl, ListItemCount | Export-Csv $OutputFilePath -NoTypeInformation

Friday, 7 November 2014

Link of site or list appears but not working in SharePoint?

Some times when you try you click on link of lists or sites in (quick launch or view all site content)and its not working. Even though you have permission to see those list and sites. Its happens when sync between content database and SharePoint frontend gets broken.


Reason:


When error occurs during creating/Deleting sites/lists then SharePoint declare those sites as orphan sites\Lists.


When you look at lists/sites it appears in view all site content but when click on it. It will throw error.




Resolution:


Go to site content and structures


http://siteurl/_layouts/sitemager.aspx


then choose the sites/list that you wish delete and click on delete.

Thursday, 6 November 2014

Web Application Migration SP 2010 to SP 2013


How to migrate web application from SharePoint2010 to SharePoint2013?
Here the steps for doing the migration:

1.    Open Central  Administration of sp2010.Then go to Application Management:






















2.    Under Application management, Go to view all site collection

3.    Select the web application which you want to migrate.





After selecting the web application, copied its database name











4.    Open sql server management studio
5.    Take a back of the database before doing back up make the database read only.
6.    Right click on the database and go to properties.

    Now take backup of the database.
7.    Now your back up file is ready so you have copied down this file to destination server.
Which is SharePoint 2013 server.
8.    Now restore that back up file of the sp2010 database in Sp2013 server.
9.    Open Sql Server Management studio




10.    When you added the backup file here, please verify the backup media. If everything seems fine then take restore of it.


11.    Restore has been done. Files get added here.
12.    Next step is to mount this database to some web application of SharePoint 2013
13.    I choose create a new web application and mount db to it. But you can also choose existing web application.
14.    Open CA of SharePoint 2013. Under that click on Application management.

15.    Click on Manage Web Application

16.    Click on New on the ribbon




17.    Enter the web application name accordingly. No need to do any thing else. Just click on oK.




18.    Web application has been created in SP 2013
19.    Now we have to take offline the database which is in connected with this web application of SP2013. And then mount our SP2010 db to it.

20.    Go to application management => Click on Manage Content database.

21.    Choose the web application on which you want to mount sp2010 database.

22.    After the set the database status to offline and remove the content database.

23.    After remove content database then the web application is not associated to any web application.
24.    Now we have to mount database to web application by STSADM.EXE command.
STSADM.EXE –O  ADDCONTENTDB  -URL http://sitename –databasename wss_content_----------------
25.    After mounting, Please check the content database.

26.    If you mounted correctly then move forward and start web application.
27.    Initially you will get look and feel of sp 2010. Then click on Start now to get SP 2013 look and feel.





28.    This sp 2013 look and feel.

29.    You will get the whole content of SP2010 but you can not get custom branding of SP2010.
30.    For that customization is required at SP 2013.

Wednesday, 5 November 2014

RSS FEED

Introduction

RSS FEED

Really simple syndicate technology which is widely used for transmitting information across internet and intranet.
Sites offer rss feed which you can subscribe and gets information from source site.
You can also subscribe rss feed for sharepoint list/libraries.

Building the Sample

Needs to RSS feed setting is enable at web application level

  • Go to CA
  • Go to Application Management
  • Go to Manage Application and choose web application
  • Under ribbon , click on General settings
  • Check RSS field is checked or not. If not please checked it and saved.

Need to check rss feed is enable at site collection level.

  • Open site collection
  • Go to site Actions
  • Go to Site settings
  • Under Site collection administration => RSS
  • Click RSS
  • Check "allow rss at site collection" is checked or not. If not please enable it by checking.
  • Check "allow rss at site"

Now we are ready for implementing rss feed on the site.





Description
For implementing rss feed on the site we have to do two things:

  • First we need obtain source site rss feed url
  • Then we need add that url to some web part (rss viewer) or page

How to obtain rss feed url of some site.

Note : you will get rss feed url of only those site which were providing rss feed for their site.

Open the source site and then click on the rss feed sign which is on favorites bar.As you click on this sign source site is gets redirect to its rss site.




For example : I hit http://timesofindia.indiatimes.com/ then i click on rss feed sign in avorite bar , it redirect to its rss feed site url: http://timesofindia.indiatimes.com/rssfeeddefault.cms .

Please copied the rss feed url of the source site.

Open the page where you want to see rss feed result. RSS feed can be added to rss viewer webpart and page too.

Add rss viewer webpart to the page. Edit web part and add the "source rss feed url here". Click on save.

Now rss viewer will show the rss feed results.
 



More Information

How to set time interval for rss feed ?





  • Go to Site Action
  • Go to Site Settings
  • Click on RSS
  • Under Advance Setings , set Time to live = ?(minutes)
 
How to set item limit?
  • Open list/ library settings
  • under communication click on rss settings
  • Item Limit set here
  • Aslo set upto how manys days these data would be visibe in rss feed

Tuesday, 4 November 2014

List view threshold

List view threshold is termed as LVT.




SharePoint developer introduced this settings at web application level. In order to avoid the server performance issue. It really matters for server performance if you are about to view 1000 of records on the list. Because all the data is available at content database and view you open the list it fetch the records from the database and display on the list.


If you set 6000 LVT on the web application level then your list will allow to view only 6000 item on the list. On the backend what it does it fetches the 6000 records from the db and display these 6000 records accordingly on the view by setting number of item view on a page.


Its not advisable to increase the LVT by 5000.


How to set LVT:


  • Go to central administration
  • Go to Application Management
  • Manage Web Application
  • Choose web application
  • Under ribbon General Settings => drop down "Resource throttling"
  • List view threshold = set limit here(try to keep it less than 5000 if the environment is production else you can keep more).





Sunday, 9 March 2014

Native SQL install Bootstrapper has not working?

cause: A setup file if your SQL SERVER gets corrupted.

Symptoms : on click on setup file , giving error "Native SQL install Bootstrapper has not working"

Resolution :
1) Dump previous installations file.
    Go to task manger, then disable all services except Microsoft services.
    Select Load Start up option
   OR

2) Then, goto control panel, goto program. then click on turn on/off windows features.
     Select all .net framework 3.5.1 options.
     click ok.

Give restart to to machine.