Thursday, May 26, 2016

Get all the site collection with content DB details using powershell commands

As discussed earlier power shell commands are pretty powerful than SharePoint object model code. Some time we can't run SharePoint object model code in production environment like gathering site/server/DB details.

We can get sites and content DB details using following power shell commands 


$rootSite=New-Object Microsoft.SharePoint.SPSite("Web app URL")
$spWebApp = $rootSite.WebApplication 
foreach($site in $spWebApp.Sites) {
    
    write-output "$($site.RootWeb.Url) - $($site.ContentDatabase)"     
  
    $site.Dispose() 

Excel Service in SharePoint 2013

Excel services in SharePoint allows use simply, Share and manage the excel workbooks at enterprise level. In excel service we have three sub components for interaction in excel services. Excel calculation service, excel web access, Excel web service, User defined functions, ECMA Script, and REST service as shown in the image below. Excel web access, web services, Calculation service, User defined functions, ECMA script are divided into two groups as Web Front end (front-end server) and application server (back-end application server)


Excel Web Services, REST API, ECMA Script can be divided in to components of front-end server and  User Defined Functions and Excel Calculation services are divided in to components of Application Server.
Excel web access renders the workbooks on a webpage and allows users to interact with the workbooks and explore them. Web Access is the excel service component that visible to the user without installing anything in the client machine.

Excel web services is the component that provides programmatic access to the web service. We can develop the applications to calculate, set and get the values form excel workbooks by using the excel web services.

Excel calculation services helps to load the workbooks, calculate, to call custom user defined functions and refreshes the external data. It will maintain the sessions in the interactions with workbook. Excel services also maintain the caching for opened excel workbooks, calculation states and data query results for improved performance.

User defined functions allows us to call the custom managed code functions and deployed to SharePoint server.

REST API enables to access workbook elements using URL. The URL contains a path for entry point to an aspx page. Excel services REST API enables the developers to explore the content workbook.

We can publish the excel workbooks through excel service in SharePoint. We can manage and secure the published work books according to the enterprise needs. Excel services was introduced in SharePoint 2007 and available in SharePoint 2013 enterprise version. The primary usage of the excel services is business intelligence. Excel workbooks can be connected in to external web sources and workbooks can be published in SharePoint doc library. As mentioned earlier, Excel services will helps to render the excel work book in the browser.

Create Excel Service application
To create the excel service application; “Excel Calculation Service” must be started in the server. To start the excel calculation service, click on “Manage Services on server” link in Application Management.



Select the server where we want to start the service above the services list and in the services list, start the excel calculation service.







Navigate to “Application Manage management” page and Click on “Manage Service Applications” link to create new Excel service application.


Click “New” button and select “Excel Services Application”




























Enter the Name of the excel service application in create new excel service application page.


Select “Create new application pool” radio button and enter application pool name and specify the service account to run the application pool. Check “Add this service application's proxy to the farm's default proxy list. ” Check box to add the service to the default proxy list.

Monday, May 2, 2016

What is a WebPart in SharePoint - Understanding the basics of an Out of the Box (OTB) WebPart in SharePoint 2013

This article on what is a SharePoint WebPart, is the first article on Out of the Box SharePoint 2013 WebPart series. This article explains in details about the key components of a SharePoint WebPart which would help the SharePoint newbies to understand the basics better.

So, what is a WebPart?

WebPart in SharePoint, from a developer perspective, is basically a user control, packaged and deployed at Site Collection level to be re used across all the sites under it.
From an End User perspective it’s a single unit of re-usable component that can be added to a SharePoint page to perform a specific task.

Dissecting a WebPart

Now let’s see what is there inside a SharePoint WebPart by adding an Out of the Box (OTB) SharePoint WebPart to a page.
To begin with, create a new Publishing Site in SharePoint 2013 and edit the Home page (default.aspx) by clicking the Edit Page under the settings menu in the right hand side corner of the page.
clip_image001
Scroll down the edited page and select the WebPart menu of one of the WebPart available in that page. Select the “Edit Web Part” to view the properties of WebPart. (Here I have selected the first WebPart in that page, which is a content editor WebPart)
clip_image002
The properties window will be displayed in the right hand side of the page as shown below.
clip_image003
The properties of the Webparts are displayed in categories. The categories “Appearance”, “Layout” and “Advanced” are common to all Webparts irrespective of the type of WebPart.
Now let us see some of the basic properties available in these categories.

Appearance Category

clip_image004
Chrome State
By default it would be set as Normal, the other option is Minimized. If it’s set to Minimized the WebPart content will be hidden from display.
Chrome Type
This property controls the display type of the WebPart. If this property is set as None , the WebPart displays the content without any border or title. If it is set to Default , then Title and Border will be displayed.

Layout Category

clip_image005
Hide
Selecting this will hides the web part from display
Direction
Changes the direction of text (content) alignment
Zone
Displays the list of Web Part Zones available in that page. Can be used to move Web Parts from one zone to another.
Zone Index
The order in which web part has to be displayed within the web part zone. Need not to be in the continuous numbers. Web Parts will be displayed in the ascending order of Zone Index

Advanced Category

clip_image006
The Check Box items listed on top of Advanced Category are self-explanatory. This Items controls the behaviours of some of the properties that we have seen in previous category.
clip_image007
Export Mode
This property controls what has to be exported while selecting the Export Menu of Web part ( 3 in above Image)
Title URL
If title is enabled and value for this property is provided, the WebPart title behaves like a hyperlink and clicking that hyperlink will opens the URL that is provided in this property.
Help URL
The URL provided to this property acts a help document for this WebPart. Providing a value to this property enables Help menu in the Web Part. (Item 4 in the above Image)
Help Mode
This property controls the behaviour of opening the help page. Like, opening in same page, showing it as PopUp etc.
Catalogue Icon Image URL
This property would enable to provide a custom Image for WebPart in the WebPart Catalogue Listing (Can be seen while clicking the Add New WebPart Link). If you are developing a custom web part you can use this property to provide a custom image for your Web Part that has to be shown while selecting your WebPart to be added to the page.
Title Icon Image URL
Displays an image before the Web Part Title.
Hope, by this time you would have learned the key components of a SharePoint WebPart. In the subsequent articles we can see all of the Out of the Box (OTB) Webparts one by one in detail.
To Learn How To Create a new Custom WebPart in SharePoint 2013 with Visual Studio , Check out this article here
- See more at: http://www.sharepointpals.com/post/What-is-a-WebPart-in-SharePoint-Understanding-the-basics-of-an-Out-of-the-Box-(OTB)-WebPart-in-SharePoint-2013#sthash.z4GHtbvm.dpuf

Max number of items in a sharepoint list?


In SharePoint 2013, a list can have up to 30 MILLION items. This is the hard-coded limit where it simply won't let you create even a single other item. However, there are other limits to consider:
  • List view threshold: 5,000 items
  • List view threshold for admins: 20,000 items
  • Individual file size limit: 2 GB
  • Total site limit for content database: 4 TB
A threshold is the "soft" limit. Once you reach that point, you'll start seeing slowness and other wonky problems. I've had a list that displayed 12,000 items, all at once, in a view. We always had a LOT of problems with that view, however, and it took so long to render that it was practically useless. Once I dialed it down to a more reasonable number under 5000, the problems went away and the list view became useful again.
To see all of the limits for SharePoint 2013, please see this TechNet article. You can select other versions of SharePoint at the top of the article.
Long story short, you're well within parameters having only 30k items in the list. You'll just need to manage your views and compartmentalize the list as needed, so that individual users see only what they need and not all 30,000 at a time.

The setting for the list throttle
  • Open the SharePoint Central Administration,
  • go to Application Management --> Manage Web Applications
  • Click to select the web application that hosts your list (eg. SharePoint - 80)
  • At the Ribbon, select the General Settings and select Resource Throttling
  • Then, you can see the 5000 List View Threshold limit and you can edit the value you want.
  • Click OK to save it.