SharePoint Server 2016 Troubleshooting - Workflow Manager 1.0 - The Term 'Register-SPWorkflowService' Is Not Recognized

Issue

Today, I was trying to register the Workflow Manager Service with SharePoint Server 2106 Farm, but ended up with an error. It is a straightforward configuration but for some reason, I was getting the following error.

PS C:\Program Files\Workflow Manager\1.0> Register-SPWorkflowService -SPSite "https://test.krossfarm.com/sites/WorkflowManager" -WorkflowHostUri "https://kf-wf.krossfarm.com:12290/" Register-SPWorkflowService : The term 'Register-SPWorkflowService' is not recognized as the name of a cmdlet, function, script file or operable program. Check the spelling of the name or if a path was included, verify that the path is correct and try again.

At line:1 char:1

  1. + Register-SPWorkflowService -SPSite  
  2. "https://test.krossfarm.com/sites/Workfl ...  
  3. + ~~~~~~~~~~~~~~~~~~~~~~~~~~  
  4. + CategoryInfo : ObjectNotFound: (Register-SPWorkflowService:Stri  
  5. ng) [], CommandNotFoundException  
  6. + FullyQualifiedErrorId : CommandNotFoundException  

 

Reason

After doing a little troubleshooting and little research, I found the reason why this is failing. There are a couple of things which are causing this issue.

You are trying to run the command in the Workflow Manager PowerShell on the Server, where SharePoint is not installed and you did not add the Add-PSSnapin "Microsoft.SharePoint.PowerShell" in the Workflow Manager Powershell.

You are on SharePoint Server but no Workflow component is installed on the Server (either Workflow Manager is installed on the Server or Workflow Manager Client is installed on the Server).

Resolution

Before opening PowerShell, please make sure that Workflow Client is installed on this Server, if Workflow Manager is not installed on this machine or Workflow manager is installed along with SharePoint. Register SpWorkflowService is SharePoint command, which configures SharePoint host to use the Workflow Service. Now, you have two ways to run the command either using SharePoint Management Shell or using the Workflow Manager PowerShell.

  • Method 1

    • Open SharePoint Management Shell as an administrator.
    • Now, run the Register-SPWorkflowService.

  • Method 2

    • Open the Workflow Manager PowerShell as an administrator and add the PSNAP in SharePoint. Run the commands, as shown below.
    • Add-PSSnapin "Microsoft.SharePoint.PowerShell"

Register-SPWorkflowService -SPSite "https://test.krossfarm.com/sites/WorkflowManager " -WorkflowHostUri "https://kf-wf.krossfarm.com :12290.