Register-SPWorkflowService Failed to query the OAuth S2s metadata error

July 8, 2013

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’. 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.
At line:1 char:1 + Register-SPWorkflowService -SPSite “http://xxxx” -WorkflowHostUri
“http …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share…WorkflowService:
   RegisterSPWorkflowService) [Register-SPWorkflowService], InvalidRequestExc
  eption
    + FullyQualifiedErrorId : Microsoft.SharePoint.WorkflowServices.PowerShell
   .RegisterSPWorkflowService

WFerror1

Solution:

When looking at the SharePoint logs – the error details are

Microsoft.Workflow.Client.InvalidRequestException: Failed to query the OAuth S2S metadata endpoint at URI ‘http://xxxx/_layouts/15/metadata/json/1’. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server – ActivityId: 1b2624e2-42a0-4a93-8c93-2ada0630967c. NodeId: xxxx. Scope: /SharePoint. Client ActivityId : 487d86fd-c961-4d8c-aab2-47269989b292. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.     at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)     at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     — End of inner exception stack trace —     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)     at Microsoft.Workflow.Client.ScopeManager.PublishScopeInternal(ScopeDescription description, String[] pathSegments)     at Microsoft.SharePoint.WorkflowServices.WorkflowServerPairingContext.EnsureFarmScope(Boolean configureOAuth)     at Microsoft.SharePoint.WorkflowServices.PowerShell.RegisterSPWorkflowService.InternalProcessRecord()     at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()

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 :-).


SharePoint 2013 – Search component degrade errors

April 19, 2013

Issue: After modifying the search topology you may be seeing one of the search component with degraded icon as shown below.

s_d2

Reason in this case is that I have changed the search service account, when you provision the search service application with the PowerShell script – central admin app pool account will be used as Search service which is not a good practice.

after changing the search service account – index location changed the icon changed to degraded.

Microsoft.Ceres.SearchCore.Journal.JournalComponent[Configuring] Component failure: Failed to configure component Microsoft.Ceres.CoreServices.Services.Configuration.ComponentConfigurationException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) —> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))     at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)     at Microsoft.Ceres.CoreServices.Storage.Util.StreamFactory.CreateFileHandle(String path, FileMode mode, FileAccess acc, FileShare share, Int32 fileOptions, Int32 blockSize)     at Microsoft.Ceres.CoreServices.Storage.AbstractD

Solution:

Looking into SharePoint 2013  logs – after modifying the search service account, WSS_WPG group doesn’t have access to the Index location. (In my case I have changed the index location from default to a different directory).

after assigning the WSS_WPG group Full access to the index location , index component status back to normal !!.

s_d3

Hope this helps some one :-).


SharePoint 2013 Search – Add Index Replica

April 19, 2013

Topic – How to add an Index Replica to web front end servers in SharePoint 2012 – Search topology:

For many reasons you may want to extend your SharePoint 2013 search topology and one of the requirements is add Index Replica to dedicated web servers or web front ends. Below is the procedure how we can do this.

here is the screen shot with one server – search service application provisioned with all roles in that box.

s_q1

Two more web front end servers are added to the Farm (WFE01 and WFE02). Our end goal is assign add index replicas to the front end servers as below:

s_q2

Ref: http://technet.microsoft.com/en-us/library/jj862355.aspx#Search_Index_Repl

Imp Note: Before you start working on the PowerShell command, add the Firewall inbound rule to allow TCP port 808 on all SharePoint servers of the farm

Here are the PowerShell commands how to do it:

#clone the Active search topology

$ssa = Get-SPServiceApplication -Name “Search Service Application”

$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active;

$clone = New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $active;

#Start the EnterPrise Search Component on wfe

$WFE01 = Get-SPEnterpriseSearchServiceInstance -Identity “WFE01”;

Start-SPEnterpriseSearchServiceInstance -Identity $WFE01;

# wait for 5 mins to start the search services

sleep 5;

# Make sure the search service instance status online before proceeding next steps

Get-SPEnterpriseSearchServiceInstance -Identity $WFE01;

# wait untill the status online before proceeding next steps, once the status online

# Add index replica on wfe

New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $WFE01 -IndexPartition 0;

#Activate the cloned search topology

Set-SPEnterpriseSearchTopology -Identity $clone;

#At this point PowerShell command prompt freezes until the search topology active. once it is active you can refresh the Search service application and see the topology changes;

#Repeat the same process for WFE02.


SharePoint 2013 Search – Assign query role to web servers

April 19, 2013

Topic – How to assign query role to web front end servers in SharePoint 2012 – Search topology:

For many reasons you may want to extend your SharePoint 2013 search topology and one of the requirements is assign the query role to dedicated web servers or web front ends. Below is the procedure how we can do this.

here is the screen shot with one server – search service application provisioned with all roles in that box.

s_q1

Two more web front end servers are added to the Farm (WFE01 and WFE02). Our end goal is assign query roles to these two web front end servers as below:

s_q2

Ref: http://technet.microsoft.com/en-us/library/jj862354.aspx

Imp Note: Before you start working on the PowerShell command, add the Firewall inbound rule to allow TCP port 808 on all SharePoint servers of the farm

Here are the PowerShell commands how to do it:

#clone the Active search topology

$ssa = Get-SPServiceApplication -Name “Search Service Application”

$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active;

$clone = New-SPEnterpriseSearchTopology -Clone -SearchApplication $ssa -SearchTopology $active;

#Start the EnterPrise Search Component on wfe

$WFE01 = Get-SPEnterpriseSearchServiceInstance -Identity “WFE01”;

Start-SPEnterpriseSearchServiceInstance -Identity $WFE01;

# wait for 5 mins to start the search services

sleep 5;

# Make sure the search service instance status online before proceeding next steps

Get-SPEnterpriseSearchServiceInstance -Identity $WFE01;

# wait untill the status online before proceeding next steps, once the status online

# Add new search compomenent on wfe

New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $WFE01;

#Activate the cloned search topology

Set-SPEnterpriseSearchTopology -Identity $clone;

#At this point PowerShell command prompt freezes until the search topology active. once it is active you can refresh the Search service application and see the topology changes;

#Repeat the same process for WFE02.


SharePoint 2013 Find the search index location

April 12, 2013

Question:  How can I find SharePoint 2013 search index location?

Answer: Use the below PowerShell commands to find the search index location

$ssa = Get-SPServiceApplication –Name 
“Search Service Application”
$active = Get-SPEnterpriseSearchTopology 
-SearchApplication $ssa -Active
Get-SPEnterpriseSearchComponent -SearchTopology $active

Below are the screen shots:

s_fi1

You will get the search index location as

s_fi2


SharePoint 2013 – Workflow Manager 1.0 Install and configuration

April 12, 2013

In continuation to my last post, we have seen how to download Workflow Manager 1.0 components offline. Lets Install and configure with SharePoint Server 2013…

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

wf_c0

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..

wf_2

Step 3: Workflow Manager Configuration Wizard screen starts..

wf_c1

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..

wf_c2

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

wf_c4

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

wf_c5

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

wf_6


SharePoint 2013 – Workflow Manager 1.0 offline download

March 13, 2013

Problem: 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: Logon 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.

wpi_ex1

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>

wpi_ex2  wpi_ex4

screen shots of download…

wpi_ex3

How to install and configure Workflow Manager and SharePoint 2013…..next post…


Restore SharePoint 2010 site collection using DPM 2012

February 24, 2013

Problem: How to restore SharePoint 2010 site collection using DPM 2012 ?

Solution: Below are the detailed steps how to recover a SharePoint 2010 site collection using DPM 2012

Important Catch: the catch here is that a valid Site collection url needs to exist even if it a dummy site collection with a blank template or any template.

Step 1: Go to Central Administration –> Make sure that a valid url exists of the site collection you are trying to restore. if the site collection got deleted make sure to create a new site collection with blank template. (Any template is okay but preferred to have blank site collection).

Step 2: Go to DPM Console –>Recovery tab –>Select the Date and time of the backup wanted to restore

DPM_R1

Step 3: Drill down to the Content Database –> select the site collection wanted to restore –> Right click and restore

DPM_R2

Step 4:  Review Recovery Selection: review the select data is correct and click Next

Step 5: Select Recovery Type: select “Recover to original site”. (Note: Recover to an alternate site is different post for another day)

DPM_R3

Step 6: Select Recovery Process tab  – “Recovery without using a recovery farm”

DPM_R4

Step 7: Specify Temporary Server tab – select “SQL instance” and Database file location – SQL instance is the DB server where DPM account have administrator privileges and have access. File location is the folder where the DPM can use to dump the Database and mount to SQL server. the size should of the size of the database that is restoring.

DPM_R5

Step 8: Specify staging location: this is the folder location on the web front end server where DPM backing up or DPM have access to. Size of the folder can be the size of the item being restored.

DPM_R6

Step 9: Specify recovery options: select “Apply the security settings of the recovery point version”

DPM_R7

Step 10: Summary:  Review the recovery settings as desired such as source, destination …etc and click fire away Recover button

Step 11: Recovery status: you will see a Successful message. if any errors it will throw error message !.

DPM_R8

Hope the post is useful…


DPM 2012 for SharePoint 2010 split domain with one way trust

February 20, 2013

SharePoint Build Scenario:

If you have a SharePoint 2010 environment with split domain, i.e your SharePoint front end (application servers and web front end servers) in Domain A and SQL Server in domain B and to add the challenge there is only one way trust between the two domains, how to protect using DPM 2012 ???

Prerequisites:

As per Microsoft TechNet, DPM 2012 requires two way trust between the two domains to protect the SharePoint farm. For many reasons you don’t get the two way trust between the domains. How to make it work ??

Solution:

The ideal solution would be moving all the SharePoint infrastructure into one domain where the regular user profiles exists in the domain. if regular SharePoint user profiles exists in domain A it is ideal to build everything in domain A.

Are there any work around without moving everything to one domain?

Work Around:

without moving SharePoint Database server or two way trust between the domains, is there any work around ?

Yes, there is…build one more SharePoint web front end server in the domain SQL server exists i.e domain B (as per above scenario) . also you need to have your DPM server build in the domain B where the SharePoint SQL server exists.

It is ideal to use the service accounts created in the domain where the account is valid in both the domains. In this case domain A.

I hope to write a detailed scenario…..