Sunday, April 20, 2014

SharePoint 2013: Optimize your development Environment

SharePoint 2013 demands more resources – especially more memory. When we need to setup a SharePoint 2013 environment we can optimize resource usage in the development server by provisioning/configuring required services as well as following some other guidelines listed in this post.

Search Service Applications

 

Search Service is EXTREMELY resource hungry. noderunner process (Search Service process for crawling/indexing) is widely known for it’s resources usage footprint. In case you don’t need search service in your development server, you can delete the service application or at least stop the service. If you need to use the search service from time to time, you can keep the search service application running but stop the search service. However, if you try to stop the search service from windows service, you will find the service will be started again by SharePoint. The correct way to stopping service is from Central admin as shown below:







































If you need the search service components (crawling/indexing) on development server, you can reduce the performance level by running the following command in SharePoint PowerShell. 


Set-SPEnterpriseSearchService -PerformanceLevel Reduced

You can also control the noderunner memory consumption by changing ‘memoryLimitMegabytes’ in the config file “C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config”. Please remember, changing the value to too low might cause the search service to fail.

 

Provision Required Service Applications only


If you install SharePoint using Installation wizard, different service applications are installed but you many not need all of these service applications. From Central admin you can delete unnecessary Service applications as well as stop services. As you can see below


Stop unnecessary Web Application


Even web application running in your development environment will create w3wp process (if a separate application pool is used) or at least use resources. So if you don’t nee a web application for time being, you can stop the web application as well as related application pool from IIS Manager.

 

Visual Studio IntelliTrace


If you use Visual Studio debugging in the server and your Visual Studio supports IntelliTrace and the feature is enabled, you can disable the option. That might improve your debugging experience. 

More information on how to enable/disable the feature can be found at: http://msdn.microsoft.com/en-us/library/dd264948(v=vs.100).aspx

 

Multiple Disk Drive


If you have configured multi-server farm, you can keep some servers in another disk drive. 

For example, if you have a multi-server (4 servers – AD, SQL, WFE and App) farm you can keep two servers in any external USB3 supported external drive. So rather than four servers access the same disk space, two can be access for internal disk and other two can access for external disk.

Even if are running a single server farm, you can use an external SSD drive (or USB3) for better I/O throughput. Especially if you can move your database files in an external drive, you will experience much better performance.

 

Tracing Service


SharePoint uses a windows Service ‘SharePoint Tracing Service’ for logging. sometimes, like during deployment, you will find the log file is growing few hundreds megabytes in short time. So tracing service might take a bit role in performance. If you don’t need the log file for a period of time, you can disable the windows service. During development I usually disable the service and when I need to see the log file, I enable the service.


Saturday, April 19, 2014

PowerShell cmdlets for SSRS SharePoint Mode

Automate SSRS Management and Configuration to increase productivity

SharePoint 2010 PowerShell Script Commands for Deployment Process

The following PowerShell script commands are used in our day to day life for Deployment process on SharePoint 2010.
Adding SPSolution:
Add-SPSolution -LiteralPath "solution path\solutionname.wsp"
Install SPSolution:
Install-SPSolution –Identity “solutionname.wsp” –GACDeployment.
Upgrade the Existing Solution:.
Update-SPSolution –Identity “solutionname.wsp” –LiteralPath “solutionpath\solutionname.wsp” –GACDeployment
UnInstall the SPSolution:
UnInstall-SPSolution  -Identity “solutionname.wsp”
Remove the SPSolution:
Remove-SPSolution –Identity “solutionname.wsp”
Deploy the feature for particular site collection:
Enable-SPSolution –Identity “featurefoldername” –url “sitesurl”
Activate the feature for particular site collection:
Install-SPSolution –path “featurefoldername”
Deactivate the feature from a particular site collection:
Uninstall-SPFeature –path “featurefoldername”
Remove the feature from a particular site collection:
Disable-SPFeature –Identity “featurefoldername” –url “siteurl”

Monday, April 14, 2014

Document Management in SharePoint without folders – Introduction to Metadata (Step-by-Step Instructions)

Another interesting topic which explains why metadata is better than folders in document management in SharePoint.


 
http://sharepointmaven.com/document-management-in-sharepoint-without-folders-introduction-to-metadata/

Perform eDiscovery exercise in SharePoint 2013

In a previous post I discussed what eDiscovery is and what is its place within SharePoint 2013. In this post I will explain how to exercise an eDiscovery task using features provided by SharePoint. Before we begin, let’s break the features in to 4 components.

1. eDiscovery site Templates

If we take a scenario of an organization, which can have multiple litigation related cases, audit exercises, etc.. it can have a site collection created from the template “eDiscovery Center” to manage all. You need to keep in mind that the eDiscovery Center template is available for Enterprise license only. After you create a site collection based on eDiscovery Center template, you can centrally manage all your eDiscovery related cases.

   

To create individual cases, We have another template called “eDiscovery Case”. If we create a case using this template it will be created as a sub web.

















Each case is equipped with sections called eDiscovery sets,Queries, Exports. Furthermore record managers and others in legal team (site users) can use normal collaboration features from document libraries, calendars, task lists etc..


2. In-Place hold (In-Place preservation)

As we discussed in earlier post in-place hold is a mechanism to preserve content for litigation. Using eDiscovery features in SharePoint 2013 we can preserve content in SharePoint itself, Exchange mailboxes and Lync content. Hold can be placed either at the site or mailbox level, or can use query-based preservation.
Once you create a eDiscovery case, you can create eDiscovery sets to discover (find) and hold specific content. To preserve content, first we need to click on new item in eDiscovery sets.


It allows us to add multiple sources (SharePoint 2013 sites or Exchange mail boxes) 


After selecting the source, we can click on Enable In-Place Hold radio  button to preserve the content.

Lets assume you have thousands or millions of records in the site collection, It’ll be very difficult and expensive to process all of those content by the legal team. Gartner mentioned that, discovering right content accounts 35% of total litigation costs in USA. It sums up to billions. So to make our lives easier we can filter contents using queries.

We can filter content in 2 ways.

a) Apply filter from eDiscovery set

We can do that while we create the eDiscovery set or by editing an existing eDiscovery set. Let’s assume I have a large set of documents, and I need only content within a specific time frame and content that relate to “Research”. So I would apply a filter as below



b) Add queries to the content from Query and Export section

Lets assume that I' have multiple data sources, so I create multiple eDiscovery sets to easily manage the eDiscovery process. Then I figure out the content is still too large for the litigation process.  eDiscovery query section comes very handy at that point as I can apply filters to a specific eDiscovery set, all or multople discovery sets.













3. eDiscovery Export

Once we discover the content by above means we need to download the content so we can produce them to legal team for review. To do that there is an export tool.

To export the content we need to go to search and export section and click on export button






















We can either download content or download the content.


The export tool download documents and lists items as well. Furthermore it generates a manifest file with metadata which complies Electronic Discovery Reference Model (EDRM). This itself is a very important feature. Let’s assume the litigation team has a 3rd party tool which they use to proof read the discovered content and it can input EDRM compliant content. Then we can directly input the exported package to that system. So as you can see there can be various interactions with other systems.

4. eDiscovery API

We can use the eDiscovery API to extend default features using components of Microsoft,Office.Server.Discovery namespace.

Above is a brief introduction on how to use eDiscovery features in SharePoint. You can find further info by referring following resources

Friday, April 11, 2014

SharePoint 2013 Out of Box Web Parts

Here is the list of SharePoint out of box web parts

http://wonderlaura.com/Lists/Posts/Post.aspx?ID=214

Thursday, April 10, 2014

Introduction to eDiscovery in SharePoint 2013

Enterprise Content Management in SharePoint

Enterprise Content Management (ECM) practice was introduced to SharePoint with SharePoint 2007.From that point onwards various new ECM features were added. There were notable additions and dramatic improvements  in SharePoint 2010 ECM features. SharePoint 2013 also have added some important features to the ECM stack.













Although few eDiscovery features were available in earlier versions, I would say the complete eDiscovery solution is introduced with SharePoint 2013. Before we discuss how eDiscovery features are implemented in SharePoint, it’s better to understand the eDiscovery concept.

eDiscovery

According to the definition, eDiscovery is the prrocess of discovering electronically stored information that is relevant to legal matters such as litigation, audits and investigations. As you would correctly assume, eDiscovery is not a concept introduced by SharePoint. SharePoint has implemented the concept electronically to make record managers and other stakeholders life easier and to save the huge costs involved with the litigation process.

Generally an eDiscovery exercise consist of following steps.













Simply put, eDiscory process starts with discovering (finding) relevant content and preserve that content so end users can’t modify them. After that, preserved content will be filtered to select only relevant information. Finally it is processed by legal/audit team to produce final outcome.

eDiscovery in SharePoint 2013

As I mentioned earlier, some eDiscovery features were available in earlier SharePoint versions, but with limitations. For an example SharePoint 2007 has an ability to put records (content) on hold where users can’t do modifications on them. SharePoint 2010 introduced major improvements by allowing site level holds and introduced the concept of search based  discovery.
But there were few limitations in SharePoint 2010 version of eDiscovery. Mainly it could discover content located only in SharePoint farm. Furthermore once content is on hold they become read only. If we take a real world scenario of litigation, which might take few months to complete, would result in disruption in business operations as relevant documents are read only.
In SharePoint 2013, above 2 limitations have being addressed successfully. First limitation is addressed allowing eDiscovery to discover content from SharePoint 2013, Exchange 2013 and Lync 2013. You can get a better understanding from the diagram given below.


















The second limitation is eliminated by allowing end users to modify preserved content. But this will confuse readers as our objective is to preserve hold content to avoid modification. That’s true. but SharePoint implemented this in a smarter way.
Let’s check how it works. If a document is on hold stage and an end user modifies the content, original version of the document is moved to another library called “Preservation Hold Library”. when the same content is required for litigation, original document from preservation hold library will be provided. By doing this, it gives business users two benefits.
  • Avoid disruptions in business process by allowing users to edit
  • Save storage space as documents are not copied to different place 

eDiscovery in SharePoint 2013 includes new ways to reduce the cost and complexity of discovery. These include:
  • The eDiscovery Center, a central SharePoint site used to manage preservation, search, and export of content stored in Exchange and SharePoint across SharePoint farms and Exchange servers.
  • SharePoint In-Place Hold, which preserves entire SharePoint sites. In-Place Hold protects all documents, pages, and list items within the site but allows users to continue to edit and delete preserved content.
  • Exchange In-Place Hold, which preserves Exchange mailboxes. In-Place Hold protects all mailbox content through the same UI and APIs used to preserve SharePoint sites.
  • Query-based preservation allows users to apply query filters to one or more Exchange mailboxes and SharePoint sites and restrict the content that is held.

How eDiscovery works in SharePoint 2013

eDiscovery uses search service applications (SSAs) to crawl SharePoint farms. You can configure SSAs in many ways, but the most common way is to have a central search services farm that crawls multiple SharePoint farms. You can use this one search service to crawl all SharePoint content, or you can use it to crawl specific regions—for example, all SharePoint content in Europe.

To crawl a SharePoint farm, search first uses a service application proxy to connect to it. The eDiscovery Center uses the proxy connection to send preservations to SharePoint sites in other SharePoint farms.

Wednesday, April 9, 2014

Convert claims based login name in SharePoint

In SharePoint 2010 and 2013 we have classic mode authentication as well as claims based authentication. In a classic mode scenario, if we get LoginName using SPUser object it would result something like “Domain\LoginName”

But if the web application is configured with claims based authentication it will provide us something like “i:0#.w|Domain\LoginName”.

Let’s say we don’t need the prefix (e.g: i:0#.w ) and require only the valid login name portion (in this case Domain\LoginName). How do we get it ? Will something like below work ?
   1: var user = @"i:0#.w|dev\john";
   2: var encodedUser = user.Split('|')[1];
OK. it will work, but for this scenario only.

This is because that claims based environment is highly scalable where you can plug so many authentication providers. If you plug another authentication provider instead of windows authentication you may get different forms of encoded strings. Let’s assume you have federated authentication using email as login you would get something like below for LoginName
   1: i:05.t|Azure|myemail@gmail.com
You can see that string operations (e.g:split) we’ve used in above code will not work for this scenario. Furthermore there are so many other claim representations as well for other providers. You can get a complete list by referring this post from Wictor Wilen’s blog.

What is the recommended way to decode claims encoded string. We can get the help from “SPClaimProviderManager” class. Following code will decode claims string.
   1: private string GetLoggingName(string name)
   2: {
   3:     var manager = SPClaimProviderManager.Local;
   4:     if (manager != null){
   5:         return SPClaimProviderManager.IsEncodedClaim(name) ? manager.DecodeClaim(name).Value : name;
   6:     }
   7:     return name;
   8: }
It’s better to avoid string operations to decode/encode claims as we don’t know what providers will be plugged or unplugged in our claims environment future.

SharePoint 2013 Timeline web part

In SharePoint 2013 we are given a great new feature, which is the ability to display tasks in a timeline. This is somewhat similar to what we have in MS Project Server. This feature is very helpful to track our tasks as they are visually organized with their staring and end dates. The Source of Timeline can be set to any Task list across Sites and Site Collections.
 
The Timeline web part provides the timeline without the Summary or Quick Edit links. This allows the user that is managing the site to use the web part as per their needs, whether that is managing the tasks or simply viewing them. The Timeline web part also provides the ability to move the layout of the tasks. Users can still quickly interact with the tasks on the timeline by clicking the task, which brings up a dialog with common editing options such as opening the full item or removing the task from the timeline.

To add a Timeline web part to a SharePoint page follow below steps:
 
Edit the SharePoint page and then from the Ribbon click on Insert Tab and from there click on Web Part icon.
 
This will open the webpart categories page, where it will show list of web parts. From there select the "Content Rollup" category. In this category select "Timeline" web part and then click on Add as shown in the fig below.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
This will add the timeline web part to the page successfully.

Then we need to give a data source to the timeline web part. The data source can come from other site collections also. This data source URL is nothing but a task list URL.

To give the data source URL, edit the timeline web part and then in the Data Source section, give the data source URL in the Select the data source to connect to the timeline. 

In the Web URL section, give your site URL, And click on Valid URL to check if it is a valid URL, then the Type and Source dropdown will get autopopulated. And from the Source you can chose the List URL and also you can choose the View Name from the View Name section. 
 
Check fig below:
 


 - It will look like the below fig:



 
 

Tuesday, April 8, 2014

Difference between LoadQuery() and LoadDataQuery() in SharePoint 2010


In this post I will discuss what is the difference between LoadQuery() and LoadDataQuery() in SharePoint 2010.

The Client Object Model has two load methods: Load() and LoadQuery().

Load method populates the client object directly with what it gets data from the server i.e. a collection object like ListItemCollection etc. But LoadQuery returns the data as a completely new collection in IEnumerable format.

The Collections that you load using the Load() method are eligible for garbage collection only when the client context variable itself goes out of scope, where as, in these collections go out of scope at the end of IEnumerable list.

The Load() method does an in-place loading of the data returned from the server. All of the data returned from the server is stored and tracked inside of the ClientContext object. The ClientContext tracks the object IDs of the items and properties returned from the server.

The LoadQuery() method returns the results as new objects. These objects are not part of the ClientContext and a result can be easily managed and discarded when not needed any more.

Example LoadQuery():
 
var query = from list in clientContext.Web.Lists  
where list.Hidden != false  
select list;  
 
var result = clientContext.LoadQuery(query);  
clientContext.ExecuteQuery(); 

Example Load():
 
var web = clientContext.get_web();  
var lists = web.get_lists();  
clientContext.Load(lists, 'Title');

Thursday, April 3, 2014

Error while opening files in SharePoint - Unable to open office files in SharePoint Office client

While working with a heavy load SharePoint some users might get an issue while opening documents/excel sheets/ PowerPoint in office client applications. 

 

Files that are stored in SharePoint, while opening files from client application might get the following error:


Could not open "http://Servername/Documents/Doc". 

After digging into the issue, found that SharePoint Workspace temp files are stored in Office Cache location which is used for synchronizing as stored in the location below,

"C:\Users\login_user_name\AppData\Local\Microsoft\Office\14.0\OfficeFileCache"

By cleaning the temp files we can fix this issue.

How to schedule SharePoint backups with PowerShell

  
Below is the link how to schedule SharePoint backups for powershell
 
Use PowerShell to Back Up SharePoint Installation