SharePoint24x7 It's all about SharePoint.

20Sep/150

Tips n Tricks – Selecting Services to run in the farm in SharePoint 2016 IT Preview

Posted by Joy

I assume by now most of you have installed and tried SharePoint 2016 IT Preview.

Except the change in the Specify Server Role page in the SharePoint Products Configuration Wizard asking us to specify the role of the server (Min-role), another change we can see in the installation and configuration of SharePoint 2016 IT Preview is, we can specify what services we want to run in the farm using Initial Farm Configuration Wizard.

As you can see below, we get a new section in Initial Farm Configuration Wizard, right below Service Applications selection, to choose what services we need to run in the farm.

Services in the farm

This reduces one of the configuration steps which we need to after running Initial Farm Configuration Wizard in the previous versions of SharePoint.

3Jul/150

Tips n Tricks – Reducing the SharePoint Config Log file size

Posted by Joy

Today we came across with a situation where we keep getting a runtime error when we try to perform our normal day-today operations in our SharePoint 2013 based solution. It started throwing a runtime error with a error code - HRESULT: 0x80131904 and it failed to save data into the SharePoint database.

The reason was the SharePoint Configuration database LOG file has grown to 91 GB and there was not enough free space in the physical disk. Because of this, SharePoint was unable to commit database changes and there was a huge performance impact. The solution we found was:

  1. Change the recovery model for the Database from Full to Simple
  2. Shrink the database

I executed the following SQL command and it brought the database log file from 91GB to 1 MB which solved my issues.

USE [master]
Go

ALTER DATABASE[SharePoint_Config] SET RECOVERY SIMPLE WITH NO_WAIT
Go

USE [SharePoint_Config]
Go

DBCC SHRINKFILE ('SharePoint_Config_Log')
Go

30Dec/140

Tips n Tricks – Navigating through SharePoint ULS logs using PowerShell

Posted by Joy

When troubleshooting SharePoint farms, ULS logs play a vital role. ULS logs are the entry point for both Administrator and Developers when they start investigating an issue in a SharePoint farm.

Usually ULS logs are created in the following directory in SharePoint servers:

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS

ULS log files are easier to locate among other log files since their file name start with the server name and followed by a the timestamp.

ULS Logs directory

ULS logs contains very detailed information compared to Windows Event Logs. Following is a sample of a ULS log file:

ULS Logs

One of the big challenges/ pain point with regard to ULS logs are reading/ navigating through them. Since they are very detailed, going through them is really challenging. When we open a ULS log file, by default it opens in Notepad and it is really difficult to navigate through them.

Most of us try using lot of 3rd party tools for navigating through ULS logs without knowing that PowerShell also provide a powerful option for us to navigate through ULS logs.

Open SharePoint 2013 Management Shell and issue the following PowerShell command:

Get-SPLogEvent | Out-GridView

PowerShell command

This command will open up a new windows with a Grid View view of ULS log file. This allows us to navigate and filter ULS log entries easily compared to Notepad.

ULS Log Grid View

ULS Log Grid View Filtering

7Jan/140

Tips n Tricks – tweaking the Windows PowerShell Profile

Posted by Joy

Windows PowerShell is the primary scripting tool available for SharePoint Administrators and Developers. Scripting was something most of the developers wanted to stay away from. But now it’s time for all the developers to master Windows PowerShell scripting since it is the core scripting platform from Microsoft. Just like Shell Scripts in Unix and Linux platforms, Windows PowerShell is the key to scripting within Microsoft technology stack.

Let’s get started with Windows PowerShell. Smile

When it comes to writing PowerShell scripts for SharePoint, we have no of tool options:

  • Windows PowerShell console window
  • Windows PowerShell Integrated Scripting Environment (ISE)
  • SharePoint 2013 Management Shell

Most of us who are into SharePoint, always prefer using SharePoint 2013 Management Shell since it loads all the SharePoint cmdlets by loading Microsoft.SharePoint.PowerShell.dll into the scripting environment.

If we are going to use Windows PowerShell console window or Windows PowerShell ISE, we will have to explicitly load the Microsoft.SharePoint.PowerShell.dll by executing following PowerShell command in order to being able to use SharePoint cmdlets.

Add-PSSnapin Microsoft.SharePoint.PowerShell

If you are writing very large, interactive scripts very often, it is probably easier to use the Windows PowerShell ISE, rather than the PowerShell console window or the SharePoint 2013 Management Shell because this provides a better editing and debugging environment. However, downside of using the PowerShell ISE is you will have to load the Microsoft.SharePoint.
PowerShell snap-in into the ISE as well every time you open it. It will be done by using exactly the same script shown above.

If you find yourself using the PowerShell ISE a lot, you can be smart to save your effort and time by adding the SharePoint snap-in automatically when the PowerShell ISE starts. You can do this by tweaking the Windows PowerShell profile.

The Windows PowerShell profile is a Windows PowerShell script file that runs every time you start Windows PowerShell. It has a .ps1 extension like any other normal Windows PowerShell script file. We can put any valid Windows PowerShell cmdlet in it so that they get executed every time we start Windows PowerShell. This is very similar to using Environment variables concept to configure startup options back in Windows Command Prompt tool. The only way in which the PowerShell profile file differs from a normal PowerShell script file is in its file name and file location.

If you are planning to use the PowerShell profile to configure startup cmdlets, as the first step, we need to figure out whether a PowerShell profile already exists on the server. We can figure out whether a PowerShell profile already exists by issuing following command:

Test-Path $profile

Check for profile

Check for profile

If the PowerShell profile already exists, above command will return “True”. If it doesn’t exist, it will return
False”.

If it returns either True or False, (i.e: whether the PowerShell profile exists or not), if you want to find out the default location of the PowerShell profile, you can run the following command:

$profile

Location of the profile

Location of the profile

And then, we can use Windows Explorer to browse to the path returned to make required modifications into the PowerShell profile script file.

If there is no file in that location. it means PowerShell profile does not exists and we need to create a new profile.

Use following command to create a new PowerShell profile if one doesn’t already exist.

New-Item -path $profile -type file

In case, if you receive an error response similar to one shown below as a result of executing the above command, make sure you have the correct folder path already in placed for the command to go and create the script file.

Error creating the profile

Error creating the profile

If the folder path exists and if it does create the PowerShell profile file successfully, you should receive the following response.

Creating the profile

Creating the profile

Use Windows Explorer to navigate to the file location and open the profile script file using any text editor such as Notepad.

Locating the profile

Locating the profile

Enter the following PowerShell command in the file, Save the script file and close the text editor.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

Tweaking the profile

Tweaking the profile

Now you are all set to use Windows PowerShell ISE and Windows PowerShell console window to write SharePoint scripts. Now when you open either Windows PowerShell ISE or Windows PowerShell console window, it reads the PowerShell profile script file and load SharePoint PowerShell snap-in automatically.

Happy scripting…!!! Smile

29Oct/130

Tips n Tricks – SharePoint 2013 support for Windows Server 2012 R2

Posted by Joy

I'm blogging this quickly to make sure that you guys won't waste time like me trying to install SharePoint 2013 on a Windows Server 2012 R2 machine.

I was trying to setup a new virtual machine and as usual I went and downloaded all the latest software through my MSDN Subscription. I installed and configured Windows Server 2012 R2 and installed Active Directory and SQL Server as usual and when it comes to installing SharePoint 2013, I lost my patience. I tried installing Prerequisites installer and it just gave me the following error:

Application Server Role, Web Server (IIS) Role: configuration error

It didn't allow me to proceed and I went searching Bing and Google and found number of posts suggesting me to try following:

None of the above workarounds didn't make my life better and it just gave me the same error and stopped Prerequisites installer giving me the above error.

Finally, I decided to do another search and here is what I found from Bill Baer's blog - http://blogs.technet.com/b/wbaer/archive/2013/09/22/sharepoint-2013-support-for-windows-server-2012-r2.aspx :

Summary

Currently, Microsoft SharePoint Server 2013 is not supported for installation on computers running the Windows Server 2012 R2 operating system.   Installing SharePoint Server 2013 on a computer that is running Windows Server 2012 R2 could lead to unexpected behavior, therefore, Microsoft does not support SharePoint Server 2013 in Windows Server 2012 R2.

SharePoint Server 2013 with Service Pack 1 and SharePoint Foundation 2013 with Service Pack 1 will offer support for Windows Server 2012 R2. The release date for Service Pack 1 for SharePoint Server 2013 and SharePoint Foundation 2013 is to be determined. This article will be updated as more information becomes available.

I found the answer to my problem and it doesn't support Windows Server 2012 R2. I'm going to start from the scratch with Windows Server 2012 and I believe Bill Bear's blog will give you more information about this issue.

5Mar/121

Article – Microsoft Office 365 Desktop Setup

Posted by Joy

With the introduction of Office 365, I see lot of customers are very interested on moving to the Cloud. If we look at the industry today, majority of customers have any form of Cloud presence – Public, Private or Hybrid.

Some customers have gone completely into either public or private cloud and some are still use both on-premise and online with Hybrid model. No matter which deployment it is, it support content access and collaboration using any devices including Mobile, Tab, Laptop and Desktop.

When we use any platform, first we need to make sure that we meet minimum software requirements for the particular platform in order to unlock full feature set and  there no excuse for Office 365 as well. Office 365 team simplifies our process of getting your desktop configured with minimum software requirements with an automated installation process called Office 365 Desktop Setup.

Office 365 Desktop Setup is an installer that checks for and provides important software updates to keep your system synchronized with Office 365. These updates provide seamless integration and better user experience with Office 365.

Office 365 Desktop Setup helps you to meet following software requirements:

  • Client Operating System – Windows XP SP3 with IE 7 or Windows Visa SP2 or Windows 7 or Windows Server 2008 R2
  • Client Office version – 2007 Office system SP2 or Office 2010

After you have signed in to the Office 365 portal for the first time, you should run the Desktop Setup on your computer. If you are working on multiple devices, make sure run Desktop Setup on all those devices.

How to run Microsoft Office 365 Desktop Setup?

  1. Sign in to the Office 365 portal using your Microsoft Online Services ID. URL for Office 365 portal is https://portal.microsoftonline.com/Default.aspx?lc=1033
  2. In the right side pane, under Resources, click Downloads.
    Resources
  3. Downloads page provides 3 steps for Installing Office Professional Plus, Installing Lync and Running Office 365 Desktop Setup.
    SetupStep1
    SetupStep2
    SetupStep
  4. Got to Step 3 - Set up and configure your Office desktop apps, and click Setup.
    SetupStep3
  5. It prompts you for asking privileges to download and run Desktop Setup, and click Run.
    SetupStart
  6. Desktop Setup will be downloaded.
    SetupDownload
  7. Once Office 365 Desktop Setup started, you need to sign in using your Microsoft Online Services ID.
    SignIn
  8. Once you are logged in, Desktop Setup will start checking the configuration of your desktop against minimum software requirements for Office 365.
    CheckingConfig
  9. It then prompts you with the updated required and you can select which updates you need to install depending on the services your organization has subscribed for. Select the updates you wish to install, and click Continue.
    SetupOptions
  10. You are then prompted to accept license agreement. click I accept.
    AcceptLA
  11. Microsoft Office 365 Desktop Setup will start installing and configuring the updates based on your selection. This may take a few minutes. Get some rest Smile.
    SetupInProgress
  12. Once installation and configuration is finished, it shows following screen with the name of the component installed/ configured and the status. And if there are any additional manual configuration required, following screen also will provide links to TechNet or MSDN articles.
    FinishedSetup

Now you have installed and configured your desktop with minimum software requirements to enjoy Office 365.

Enjoy Office 365 Smile.

28Dec/110

Enabling Developer Dashboard in SharePoint 2010

Posted by Joy

ASP.NET provides Call Stack and Tracing as wonderful features which helps developers on investigating what is going on page rendering behind the scene. SharePoint being a product which provides bunch of features OOTB which we can use to setup a portal very easily, it hides most of these information.

Back in MOSS 2007, we had to scratch our head thinking where to start our investigation when we get an error in the browser, because that error was not descriptive enough for us to start the investigation.

In SharePoint 2010, we have a nice feature – Developer Dashboard which helps developers to be comfortable when they see an error in the browser.

Enabling Developer Dashboard

Developer Dashboard is a feature targeted for developers (administrators as well) and hence it is disabled by default. We need to enable it using one of the method mentioned below:

  • STSADM
  • PowerShell
  • SharePoint Object Model
STSADM

We still can use STSADM with SharePoint 2010 for administering SharePoint. However, STSADM is more likely to disappear in the next release. Though we can use following STSADM command to enable Developer Dashboard, I strongly recommend to get familiar with PowerShell, if you are not already.

  1. Go to the command prompt and make sure to either set the path to the location of STSADM.EXE or navigate to the bin directory in SharePoint root in your command prompt.
  2. Issue the following command in the command prompt:STSADM -o setproperty -pn developer-dashboard -pv ondemand

The above command will enable the Developer Dashboard in On Demand mode.

PowerShell
  1. Go to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Management Shell
  2. Issue the following command in the management shell:$devdash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
    $devdash.DisplayLevel = ‘OnDemand’;
    $devdash.TraceEnabled = $true;
    $devdash.Update()

The above command will enable the Developer Dashboard in On Demand mode.

SharePoint Object Model
  1. Create a Console Application, Windows Application or Web Site and add a reference to the Microsoft.SharePoint.dll assembly.
  2. Add using Microsoft.SharePoint.Administration namespace reference at the top of the code (C#) file.
  3. Add the following code into your code (C#) file to enable Developer Dashboard:SPWebService svc = SPContext.Current.Site.WebApplication.WebService;
    svc.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand;
    svc.DeveloperDashboardSettings.Update();

The above command will enable the Developer Dashboard in On Demand mode.

I have used On Demand as the setting for Display Level of the Developer Dashboard and following are the other options we can specify:

  1. On – Enable the Developer Dashboard all the times
  2. Off – Disable the Developer Dashboard
  3. OnDemand – Enable the Developer Dashboard but will be displayed on demand.

When you enable Developer Dashboard in On Demand mode, following icon will be displayed next to your login name.

Capture1

On click of the Developer Dashboard icon, page will be reloaded and Developer Dashboard will be displayed at the bottom of the page as shown below:

Capture2

If you have also used TraceEnabled = $true switch with PowerShell, then you will see a link says “Show or hide additional tracing information …” at the end of the Developer Dashboard which allows you to show/ hide ASP.NET Tracing information as shown below:

Capture3

Isn’t this a awesome feature for you to get started your investigation exercise? Have a closer look at what Developer Dashboard offers you and it will help you in numbers of ways.

3Nov/113

Fix it – Configuring Object Cache service

Posted by Joy

If you are using Web Content Management (WCM) solutions implemented with SharePoint 2010 Publishing Infrastructure features, you will notice following Critical error in your server Event Log.

Capture9

What does it mean and how do you fix this?

This error is generated by SharePoint’s Object Cache service. In order to get rid of this error, you will have to configure Object Cache service.

What is Object Cache service?

Object Cache is a very powerful built-in service in SharePoint 2010 Publishing Infrastructure which instructs every Web Front End (WFE) to cache object properties in order to boost the performance. This reduces the load on SQL Server tremendously by reducing number of round trips required to retrieve same data from the content databases. In scenarios where you have Web Content Management solutions which go through less content changes, by configuring Object Cache, you can reduce the latency and increase the throughput.

Configuring Object Cache is all about configuring User Policies for each and every Web Applications. Object Cache is configured at the Web Application level and you need to have 02 AD user accounts for configuring Portal Super User and Portal Super Reader. Portal Super User account has full control and Portal Super Reader account has full read-only access.

Let us begin the configuration.

Task 1 – Create required AD accounts

You need to create 02 service accounts in order to configure Portal Super User and Portal Super Reader. Go to Active Directory and create 02 service accounts.

I already have 02 service accounts created named, SP_ObjectCacheUser and SP_ObjectCacheReader.

Capture1

Task 2 – Configure Object Cache User Accounts using CA

Initial configuration done using CA.

  1. Fire up the SharePoint 2010 Central Administration site by navigating to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Central Administration.
  2. Select Manage web applications link from the Application Management group.
  3. Select the web application you are planning to configure Object Cache. In my environment, for this demo, I’m selecting SharePoint – 80 web application.
  4. Click the User Policy from the Policy group in the ribbon.
    Capture2
  5. Click Add Users link in the Policy for Web Application dialog box.
    Capture3
  6. Select (All Zones) for the Select the Zone field in the Add Users dialog box and click Next > button.
    Capture4
  7. Enter the Portal Super User account for the Choose Users field and select Full Control from the Choose Permissions section and click Finish. In my demo, I have configured SP_ObjectCacheUser as the Portal Super User.
    Capture5
  8. Click Add Users link again in the Policy for Web Application dialog box.
  9. Select (All Zones) for the Select the Zone field in the Add Users dialog box and click Next > button.
  10. Enter the Portal Super Reader account for the Choose Users field and select Full Read from the Choose Permissions section and click Finish. In my demo, I have configured SP_ObjectCacheReader as the Portal Super Read.
    Capture6
  11. Policy for Web Application dialog box now will look following.
    Capture7

Task 3 – Committing configuration changes using PowerShell

Final step is to commit configuration changes using PowerShell.

  1. Fire up SharePoint 2010 Management Shell by navigating to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Management Shell.
  2. Enter the following PowerShell commands to update the settings. Change the Web Application name placeholder depending on the name of the Web Application.$wa = Get-SPWebApplication – Identity “SharePoint – 80
    $wa.Properties[“portalsuperuseraccount”] = “CONTOSO\SP_ObjectCacheUser
    $wa.Properties[“portalsuperreaderaccount”] = “CONTOSO\SP_ObjectCacheReader
    $wa.Update()

    Capture8

Now you will not see the earlier Critical error in your server Event Log as well as you will experience a reduced latency and an improved throughput.

15Dec/101

Tips n Tricks – Unlocking the full social networking experience in SharePoint 2010

Posted by Joy

By now you may have installed SharePoint 2010 number of times and explored all different installation possibilities. Even after installing the enterprise edition, you may be wondering why all the social networking features are not appearing in your farm. If you are looking for an answer for this, believe me it’s a small configuration you need to do in your farm.

Enabling the Activity Feed Timer Job

Activity Feed Timer Job is the timer job responsible for providing the missing social networking features and we need to enable the same right after installing SharePoint 2010. Perform following in order to enable the same:

  • Click Start -> All Programs -> Microsoft SharePoint 2010 Products and select SharePoint 2010 Central Administration.
  • Click Monitoring from the left-hand side of the page.
  • From the Timer Jobs group, select Review job definitions.

    SharePoint Central Administration - Monitoring

    SharePoint Central Administration - Monitoring

  • Scroll down until you get User Profile Service Application – Activity Feed Job. You may need to go to 2nd page if you don’t see it in the 1st page.
  • Click User Profile Service Application – Activity Feed Job.

    SharePoint Central Administration - Activity Feed Job

    SharePoint Central Administration - Activity Feed Job

  • Select the schedule you wish this timer job to run.

    SharePoint Central Administration - Enable Activity Feed Job

    SharePoint Central Administration - Enable Activity Feed Job

  • Click Enable to enable the timer job.

Deja Vu, now you have unlocked all the social networking features within your SharePoint 2010 environment.