Friday, 22 April 2016

SharePoint 2013 – Workflow Manager 1.0 offline download & Installation

Problem:
I want to create SharePoint 2013 workflow in SharePoint Designer. But it is not showing SharePoint 2013 workflow option. So we need to first setup workflow manager.

There is no direct download to the Workflow manager and required components that need to Install and Configure Workflow Manager 1.o with SharePoint 2013.

If the server have Internet connection “Web Platform Installer” does the job for you. This is good for quick setup of development environment but what if we want to setup on a server that don’t have internet connection. Also for consistent builds (Dev/QA/production) we need to download and install the same software across all the environments.

Solution:

Below steps provide how to download the required Workflow Manager 1.0 components.

Here is the instructions from Microsoft link : http://technet.microsoft.com/en-us/library/jj906604

(Note: Please do not confuse with the below Microsoft link to download Workflow manager 1.0, again this is not full version).

Step 1: Log on to the machine where you have internet connection and down load the web platform installer “WebPlatformInstaller_amd64_en-US.msi” from here

Step 2: Extract the files from “WebPlatformInstaller_amd64_en-US.msi” to a folder. There are different ways to extract files from msi. below is the example using msiexec utilty.

Open Command prompt or powershell run as administrator and enter the below command:

msiexec /a <msi location with folder path> /qb TARETDIR = <folder location where the files needs to be extracted>

Ex:

msiexec /a C:\SharePoint\SP2013\Tools\WebPlatformInstaller_amd64_en-US.msi /qb TARGETDIR=C:\
ePoint\SP2013\Tools\wpi

It will extract the folder structure as below.


Required “WebpiCmd.exe” available under <above target location>/Microsoft/Web Platform Installer

Step 3: Download Workflow Manager components using WebpiCmd.exe

In the command prompt or powershell

webpicmd.exe /offline /Products:WorkflowManager /Path:<folder directory to download>


Lets Install and configure workflow manager with SharePoint Server 2013…

Step1: The Workflow Components are downloaded as below folder structure..



Step 2: Run the below command to invoke the Workflow Manager Configuration Manager screen..

WebpiCmd.exe /Install /Products:WorkflowManager
/XML:<directory of workflow manager downloads>
/feeds/latest/webproductlist.xml
Eg: below..



Step 3: Workflow Manager Configuration Wizard screen starts...



Step 4: Click on Configure Workflow Manager with Default settings (Recommended). New Farm Configuration wizard opens and enter the required fields.  (Here I am talking about minimum required fields for configuration, there are advanced option parameters for setup a production farm)

SQL Server Instance: i.e The Database server for the Workflow Manager databases

Configure Service account: a dedicated domain service account for work flow manager

Certificate Generation Key: similar to Passphrase in SharePoint a password for securing the workflow manager farm. this is required when workflow manager farm extended..



Step 5: On clicking Right arrow bottom of the screen, configuration starts



Step 6: Upon successful installation all the check marks are passed with green



Step 7: Workflow manager is setups a IIS web site on the box hosting on port 12290 (for ssl) and 12291 for http (non ssl). you can add host url for the ports that are of interest in configuration such as workflowmanager (This way we can avoid using the server FQDN name while configure with SharePoint site collection)
you can verify the workflow manager Installation by accessing http://localhost:12291 or http://<host url>:12291 (if host url configured). XML file with configuration detail opens..
Step 8: Now run the below SharePoint PowerShell command to configure the workflow manager with a SharePoint 2013 site collection
Register-SPWorkflowService –SPSite “http://myserver/mysitecollection&#8221;
–WorkflowHostUri “http://workflow.example.com:12291&#8221;
–AllowOAuthHttp
Step 9: Verify the Workflow Manager configured successfully with the site collection by using SharePoint Designer 2013





Register-SPWorkflowService Failed to query the OAuth S2s metadata error

Scenario: 

You have followed all the specified TechNet requirements/permissions in setting up SharePoint 2013 and Workflow Manager 1.o farm but when Registering Workflow manager with SharePoint site collection you might have got the below error:

Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint at URI ‘http://xxxx/_layouts/15/metadata/json/1&#8217;. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server – ActivityId: 5b035802-7a59-4235-acb5-943a0e21e942. NodeId:
xxxx. Scope: /SharePoint. Client ActivityId : 66bd6434-9778-4a6f-b275-63a399d73c8c.

Solution:

Basically it is trying to connect to the SharePoint url end point (http://xxxx/_layouts/15/metadata/json/1 . In my case the SharePoint url (which has host header) was not accessible from Workflow Manager server (as I have not dns published the url). I added the SharePoint url to the Workflow manager server host file and can access the SharePoint url.

Now the Register-SPWorkflowservice command runs without issue.

Key here is that make sure that both SharePoint and workflowhost urls are accessible from the SharePoint / Workflow Manager server.

Hope this helps.

Friday, 8 April 2016

Scheduling Search Crawl in SharePoint

If you want to configure Full/Incremental/Continuous search crawl, follow below steps:

  • On the Configure Search Settings page, in the Crawl Settings section, click Content sources and crawl schedules.
  • On the Manage Content Sources page, right click the content source for which you want to schedule an incremental crawl and then click Edit.
  • On the Edit Content Source page, in the Crawl Schedules section, do the following:

Incremental/Full crawl setup:

  • If an Incremental/Full crawl has never been created for this content source, click the Create schedule link below the Incremental/Full Crawl list.    -or-
  • If you are changing the Incremental/Full-crawl schedule, click the Edit schedule link below the Incremental Crawl list.
  • In the Manage Schedules dialog box, in the Type section, select Daily, Weekly, or Monthly.
  • In the Settings section, do the following:


  1. In the Run every box, type the number of days between crawls. For example, to schedule an incremental crawl to start every other day, type 2.
  2. In the Starting time list, select the time of the day from which to start the scheduled crawl.
  3. If you want to crawl more frequently than once a day, select the Repeat within the day box and type the number of minutes to wait between crawls in the Every box and type the total number of minutes in which to repeat the crawl within the same day in the For box. For example, if you select Repeat within the day and type 60 in the Every box and 720 in the For box, an incremental crawl of the content source you are configuring starts every 60 minutes up to 720 minutes (12 hours) after the first scheduled incremental crawl for this content source ran.
  4. Click OK.


  • Click OK in  Content Source page.

Continuous crawl setup:

  • Select the continuous crawl radio button in Crawl Schedule Section.
  • Click OK in  Content Source page.

Unlike an incremental crawl, which starts at a particular time and repeats regularly at specified times after that, a continuous crawl automatically starts at predefined time intervals. The default interval for continuous crawls is every 15 minutes.

To Change the Continuous crawl time do the following steps:

Prerequisite:

  • Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

Steps:


  • Start a SharePoint 2013 Management Shell.
  • At the Windows PowerShell command prompt, type the following commands:

        $ssa = Get-SPEnterpriseSearchServiceApplication

        $ssa.SetProperty("ContinuousCrawlInterval",n)

        Where: n is the regular interval in minutes at which you want to continuous crawls to start. The default interval is every 15 minutes. The shortest interval that you can set is 1 minute.

Note:

If you reduce the interval, you increase the load on SharePoint and the crawler. Make sure that you plan and scale out for this increased consumption of resources accordingly.

Source:

    https://technet.microsoft.com/en-in/library/cc263373%28v=office.12%29.aspx
    https://technet.microsoft.com/en-us/library/jj219802.aspx

Friday, 5 February 2016

SharePoint Naming limitation in site names, folder names, and file names

This article lists the characters that you cannot use in the following names in Microsoft SharePoint:

  • Site names
  • Folder names
  • Server names
  • File names

Site names, sub-site names, or site group names

You cannot use the following characters anywhere in a site name, in a subsite name, or in a site or Active Directory group name:
  • Tilde (~)
  • Number sign (#)
  • Percent (%)
  • Ampersand (&)
  • Asterisk (*)
  • Braces ({ })
  • Backslash (\)
  • Colon (:)
  • Angle brackets (< >)
  • Question mark (?)
  • Slash (/)
  • Plus sign (+)
  • Pipe (|)
  • Quotation mark (")
  • You cannot start a site name, a subsite name, or a site group name with an underscore (_) character or with the period (.) character.
  • When you create a site name, a subsite name, or a site group name, you cannot use strings that were already used to name managed paths.
  • You cannot use the period character consecutively in the middle of a site name, a subsite name, or a site group name.
  • You cannot use the period character at the end of a site name, a subsite name, or a site group name.


Folder names

You cannot use the following characters anywhere in a folder name or a server name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a folder name.
  • You cannot use the period character at the end of a folder name.
  • You cannot start a folder name with a period character.
  • If you use an underscore character (_) at the beginning of a folder name, the folder will be a hidden folder.
  • Additionally, a folder that contains the string "_vti_" is reserved by SharePoint, and isn’t supported.
File names

You cannot use the following characters anywhere in a file name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a file name.
  • You cannot use the period character at the end of a file name.
  • You cannot start a file name by using the period character.
  • If you use an underscore character (_) at the beginning of a file name, the file will be a hidden file.
  • File names and folder names may not end with any of the following strings: 
    • .files
    • _files
    • -Dateien
    • _fichiers
    • _bestanden
    • _file
    • _archivos
    • -filer
    • _tiedostot
    • _pliki
    • _soubory
    • _elemei
    • _ficheiros
    • _arquivos
    • _dosyalar
    • _datoteke
    • _fitxers
    • _failid
    • _fails
    • _bylos
    • _fajlovi
    • _fitxategiak
  • In addition, file names and folder names cannot start with the “_vti_” string, such as the followings:
    • _vti_cnf
    • _vti_pvt
    • _vti_bin
    • _vti_txt
MSDN Link: https://support.microsoft.com/en-us/kb/905231

Thursday, 4 February 2016

How to add separator to string at every N characters?

I was having a strange requirements last days and one of them is this one:

we have a string and we want to add a separator after 8 digit.

Here is the post which help me to achieve the my solution:
http://stackoverflow.com/questions/9932096/add-separator-to-string-at-every-n-characters

Solution:

here is the solution that worked for me:

string x = "111111110000000011111111000000001111111100000000";
output should be :
"11111111,00000000,11111111,00000000,11111111,00000000,"

C# : Regex.Replace(myString, ".{8}", "$0,");

Javascript:

"111111110000000011111111000000001111111100000000".replace(/(.{8})/g,"$1,")


Error Occurred in Deployment step 'Recycle IIS Application Pool'

Currently we have moved our development environment and one common error I faced after moving them was :
Error occurred in deployment step 'Recycle IIS Application Pool':
<nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied

Solution:

Original Post: http://stackoverflow.com/questions/21278281/error-occurred-in-deployment-step-recycle-iis-application-pool

Here are the steps that worked for me:

  1. Go to Central Administration site
  2. Navigate to the Manage Web Applications page
  3. Click on the web application that hosts the site you are trying to deploy to
  4. Click the User Policy ribbon item.
  5. Add your windows account to the list of users with the Full Control permission.

Friday, 8 January 2016

Error: Value does not fall within expected range SharePoint

While accessing SharePoint Document Library files I face a strange error as the code I was using was used before and was working fine earlier. Here was the error message:

Error: Value does not fall within expected range

Code Sample:

SPFileCollection files = currentlist.RootFolder.SubFolders[curfileitem.Url.Substring(0, curfileitem.Url.LastIndexOf('/'))].Files;

I found that if I have hierarchy of folder then the above code will throw an error.                        

Solution:

Through google I found out a new method to get files collection. Here is the code sample:

SPFolder folder = properties.Web.GetFolder(curfileitem.Url.Substring(0, curfileitem.Url.LastIndexOf('/')));

SPFileCollection files = folder.Files;

Make sure you provide full path of your folder. i.e. your web path / doc library title / folder path.

Thursday, 17 December 2015

How to find the SQL Instance edition ?

Q: How to find the SQL Instance edition ?

Ans: First I thought, its Microsoft. Go to help menu and click on About. It will give you the edition you have installed. But the answer is no. This time it displayed numbers and something which was little bit hard to understand.

So what we do? google it.

And first you find links of Microsoft which is confusing to people like me. So here is the solution.

Follow below steps :

  1. Open you SQL server and connect your database.
  2. Open (Ctrl + n) new querywindow for master database.
  3. And write below query to get understandable answer:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')

Note: Above query works for SQL Server 2000 and above 

In other scenario you can use

SELECT @@VERSION
Output will be like :
       Microsoft SQL Server 2012 (SP1) - 11.0.3401.0 (X64) 

Jan  9 2014 13:22:15 

Copyright (c) Microsoft Corporation

Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)

Original Source: 

http://stackoverflow.com/questions/59444/how-do-you-check-what-version-of-sql-server-for-a-database-using-tsql

Friday, 27 November 2015

Error - URL Name can not contain any of the following characters


Assume that you type a page name, such as “Text with space” in the New item form in a pages library in SharePoint Server 2013 to create a new page. After you create the page, the automatically generated URL is inconsistent with the preview URL. For example, the preview URL may be displayed in a label as follows:



Solution:

1. Go to "Site Settings". 
2. Click on "Page Layout and Site Template Settings" under "Look and Feel".
3. Scroll down and check option "Convert blank spaces in page name to'-'".

Case 2

If you have installed SharePoint April to September Cumulative Update package 2015 then you might face above error even you have checked the option given in solution above. 

Solution: 

This issue is resolved in October 2015 Cumulative Update. Reference Links are:
https://support.microsoft.com/en-us/kb/3085567
http://thesharepointfarm.com/2015/04/ms15-036-and-april-2015-cu-createpage-issue/

Wednesday, 25 November 2015

Enable SmallSearchbox in Search result page SharePoint

Recently I was given a task to enable Search Bar in Search result page of SharePoint. If you meet such requirement here is the simple solution:

Case 1: You have not configured search service:

In this case your search will open SharePoint default result page: osssearchresults.aspx.

You can find this page in "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS".

Open this page and in "PlaceHolderSearchArea" ContentPlaceHolder add below lines of code:

 <div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />                                 
</div>

save the file.

Refresh your search page and you will see the search bar in header section.

Case 2: You have configured Search service:

In this case your search will open pages/result.aspx page for search result.
But we can't add our code in this page. We need to add our block of code in the page layout of this page.

You can find that in "Site settings->masterpages & page layouts -> SearchResult.aspx"
Download this page.

Open this page and in "PlaceHolderSearchArea" ContentPlaceHolder add below lines of code:

 <div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />                                 
</div>

save the file.

If you refresh your  page and you get error "Sorry, Something went wrong", Please check this blog.