Monday, April 27, 2015

SharePoint – Back to basics – SPLongOperation for lengthy operations

We have many hidden features in SharePoint in look and feel in Out of Box as well as custom. SPLongOperation One of the hidden feature in custom coding side. This feature exists from SharePoint but many of the users may not be aware of this. SPLongOpearation allows us to inform end users on processing screen while operating lengthy operations like moving documents from one site other, deleting sites etc... And at the end we can have options to close/ redirect the page.

Here is the sample code on usage of SPLongOperation,

                              using (SPLongOperation longOpearation = new SPLongOperation(this.Page))
                                             longOpearation.LeadingHTML = "Title of the long operation";//title message
                                             longOpearation.TrailingHTML = "this will take few sec”//sub message
                                             //Code start
                                             //Write the code that to be processed in long operation
                                             //code ends
                                               HttpContext context = HttpContext.Current;
                                             if (context.Request.QueryString["IsDlg"] != null)
                                                            context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
                                                             string url = SPContext.Current.Web.Url;
 longOpearation.End(url, SPRedirectFlags.CheckUrl, context, string.Empty);

               catch (Exception ex)
                              SPUtility.TransferToErrorPage(ex.ToString());//transfores us to the error page with error message

In the Begin and End methods for long operation we can have different overloaded methods. By using SPLongOperation.Begin method (String, String, SPLongOperation.BeginOperation) method we can pass title and sub message. Here in the script end method, iam passing redirection URL and checking flags and current context. For more details, here is the full description in msdn.

Sunday, April 26, 2015

SharePoint error – A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

While working on one of the existing SharePoint server, I tried to open the SharePoint central admin site. I got an error saying that “A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.” As shown the image below.

This is the error due to SQL server service got stopped. To fix the error we have to run the SQL Service as shown the image below.

But in my case, MSSQLSERVER service is started and running. Restarted the service, but it wasn’t worked for me. By digging in to the deep I got few details from system admin. The farm I am working is already had few sites. But before handing that to me all the sites deleted from SQL server. When I try to access the CA site it gives the error message.

Restarted SharePoint timer service, SQL server and all the servers in the farm. Nothing worked for me. Finally ran SharePoint configuration wizard. Super... it worked for me. Now I got the issue that some of my farm users deleted DB’s in sql server directly instead deleting form CA. By running the config wizard

Tuesday, April 21, 2015

SharePoint 2016…? Yes..!! it is on the way

Most of us are updated from SharePoint 2010 to 2013 recently. But here is another announcement from Microsoft regarding another new update in SharePoint – SharePoint 2016. As per SharePoint office blogs, SharePoint 2016 will be available from 2nd Quarter of 2016. Beta version might be 4th quarter of 2015.

Looks like rein this version Microsoft people most concerned on the customers using on-premises, cloud and hybrid deployments in the future and SharePoint integration with Microsoft Ignite. As per Microsoft people SharePoint 2016 concerned more on better content management, team collaboration and greater UI features all the devices.

Better UI experience: We have to make better and quick decisions to increase the effectiveness of any of the company. SharePoint 2016 provides us improved access to mobile devices to view all the content in SharePoint, permission details on different devices with touch based experience as the more in people-centric. This will be available in SharePoint on-premises and office 365 environments in SharePoint 2016. By using office graph and delve users can able to discover the relevant information stored in on-premises and cloud based environments. In SharePoint 2016, MS people more focused on integrating with Exchange and Yammer applications.

Cloud based infrastructure: SharePoint 2016 designed in the way that experiencing SharePoint on-premises as office 365 and invested more on improving the performance, reliability and scalability on hybrid environment to behave like on-premises environments. With rich UI, improved performance, this will integrate with the next release products such as Windows Servers, exchange server 2016 and next release of SQL server.

Compliances and Reporting: SharePoint server 2016 provides list of features to protect sensitive information introducing Data Loss Prevention. Data Loss Prevention is non-negotiable, and overexposure to information can have legal and compliance implications. With the use of enabling data encryption and compliance tools in on-premises environment and enabling user self-service and ensuring content usage adheres to corporate policy in office 365 environment data will be protected.

There are many things added in SharePoint server 2016. Waiting for most another successful product. Follow me to get more updates.

Source: Office Blogs

Sunday, April 5, 2015

LepideMigrator for Documents – Migration tool for SharePoint, Office 365

Recently I got a chance to explore some of the third party tool to migrate the content form SharePoint, Office 365 sites. LepideMigrator for Documents, one of the best tool to migrate the content from SharePoint. I have seen multiple features to migrate the content from SharePoint, Office 365 environments including Exchange/office 365 public folders.

LepideMigration tool supports both client and server operating systems including WindowsXP/ 7 /8 , Windows server 2003/2003R2/2008/2008R2/2012/2012 R2 for SharePoint 2013 Foundation/Server/ Office environments. It supports all the versions of exchange servers and outlook to migrate the content. You can see the prerequisites and download details here. We have two types of licensing models for this tool. In Subscription License type, we can get the product for a period of time. We have to renew the product license once after the period. Using Perpetual License, we can use the product without expire. For this type we don’t have expiry period.

After installing the tool we can see following screen.

To work with this tool, we need to have Admin permissions to the user who runs the application. In Exchange server user need access all the mail boxes. To add the site collection the tool, click on Ad New Site under File tab. Right click on SharePoint server, select Add new SharePoint site. This will prompt us Addd new Site window for project name, site address and user credentials details. To enumerate the complete Site Collection, click on “Find Site Collection” button, provide Central Admin URL with username and password details. Click on Next button. At the end tool prompts with another window requesting username and password details to connect the server. Provide username and password, click on Ok to connect the server.

We can get the all the web application details as shown the image below.

Select the web application and click on Next to view all the site collections. Click on Finish button to view the web application and site details as shown the image below.

In the Same way we can connect File system, Public folders by using the options under file tab using the steps shown in this document.

Before starting migration, we can validate the SharePoint site. This is a great feature comes with this tool. We have the option to validate the file size, invalid characters, blocked file types and names and type of the files. After specifying source details, we have to specify the destination where we need to move the files and map the files before running the migration. If we are running the migration for file system to SharePoint site, we can see the dialog box including all the files and folders to migrate to SharePoint.
After checking the tool for some time I have observed lot of features. We got a great tool to migrate the documents in SharePoint, File system and exchange servers. Here are top features,

Universal tool for all migrations:  By using LepideMigrator tool, we can migrate the content form SharePoint, File system and exchange servers.

Analyzing the details before starting migration: As I said earlier, we can validate the SharePoint site/ File system details before starting the migration. We can have the options to validate the details before running migration. We can get the details about the issue that might face in the migration.

Validating data according to SharePoint: We have options to validate the data according the SharePoint. This is one of the feature I like most, you can analise whether the selected content can be uploaded to the SharePoint server or not. You will be able to know what all issues may come during migration.

Migrating metadata: Metadata is responsible for searching for any documents in SharePoint. Customers are very specific about search as they have lot of data on their environment. So we must get the metadata when we are migrating the content. LepideMigrator for Documents helps us transferring attributes not even to file to folder, email, contact etc. also.

Adding multiple sources same time:  By using LepideMigrator for Documents we can connect multiple sources including file servers, office 365 folders, Public folders, mail boxes and achieved mail boxes in the process of migration.

Managing permissions: In SharePoint environments we have lots of private/sensitive data that many of the users are not allowed to see. When migrating the documents from source to destination permissions should not break. LepideMigrator copies the permissions same as source.

Schedule migration:  We can schedule the migration for a specific date, time by using LepideMigrator. Migration will run that time without manual assistance. This reduce the outage for SharePoint site.

Bulk Migration:  Last but not least, this the best feature in LepideMigrator tool. We can select all the files in one click to process bulk migration. This tool will generate .csv file for all the content selected to migrate. 

Friday, April 3, 2015

SharePoint 2013 - Update master page styles in SharePoint hosted apps without coding

One of my project I got a requirement to remove top suite links in a SharePoint hosted master page. But app was not developed by us. It is third party app. We don’t have code for the app. We just got app file and configured it in app site collection.

But one of management asked us to remove top suite links (Sites, One Drive and Newsfeed). We need to update the app master page links. I have worked on app, but all did form code side. But we don’t have code access now.

Generally we can have options to see site settings and all site contents of the app web by navigating to http://appweburl/_layouts/settings.aspx, http://appweburl/_layouts/viewlsts.aspx ). But in our app, app developers restricted to view those pages. I have tried to edit the app page as it is general SharePoint page. But I am unable to edit the page.

Finally a simple trick worked for me. Navigated to master page gallery http://appweburl/_catalogs/masterpage. Yes, I have access to master page gallery. In master page gallery I have seen all master pages related to SharePoint 2013 (app.master, seattle.master, oslo.master..etc.) By default app web use app.master page. Download app.master to your local and add CSS/JavaScript code to the master page. Upload it to masterpage gallery again.

In my case I just made added #DeltaSuiteLinks{display:none} style in the master page. It worked for me. But make sure check this before in Dev/Stage before updating the production.

Hope this helps.