<{{Subtitle_Weight}} class="prominent-subhead {{Show_Subtitle}}"> {{Header_Subtitle}}

SharePoint 2013/2016 Health Check and App Deployment Script

This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Run AppDeployment.exe from the Installation folder of your downloaded product to check the health of your SharePoint environment and to deploy the K2 for SharePoint app. This functionality is also available as PowerShell scripts to help you automate these tasks.

The health check script (SPHealthChecker.ps1) is the script that you can run manually but is also an option in AppDeployment.exe.

The deployment scripts setup the server-to-server (S2S) certificate and upload the app. This allows you to automate the deployment of the K2 for SharePoint app to a SharePoint app catalog, eliminating the need to use AppDeployment.exe.

These scripts are version-specific. You must install your version of K2 to a development or test environment and run AppDeployment.exe, and then use the generated scripts to do further testing or installation on your other environments. The example scripts available for download correspond to the latest version of K2.

Health Check Script

When you run AppDeployment.exe on your SharePoint server, you see an option to check your SharePoint environment before installing the K2 for SharePoint app. These pre-checks ensure that your SharePoint environment is ready for apps. There is also a series of post-checks that are performed after the K2 for SharePoint app is installed in your app catalogs. The results of each of these series of tests can be exported to a text file in order to share with your K2 support representative, if necessary.


Run the K2 for SharePoint Application Deployment.exe to extract the SPHealthChecker.ps1 script. Once extracted, the script is located at ..\K2 for SharePoint Application Deployment\Repair.

Application Deployment Scripts

The application deployment PowerShell scripts allow you to use a PowerShell script to 1) setup the server-to-server communication between SharePoint and K2, and then 2) deploy K2 for SharePoint to your on-premises SharePoint app catalog associated with the site collection on which you plan to use K2 integration. You must execute these scripts on the SharePoint machines, and for each app catalog (if you have multiple catalogs).

If you do not see these scripts in your installation folder (such as SetupS2S-[siteURL-port].ps1 and UploadApp-[siteURL-port].ps1), you have not run AppDeployment.exe. Run it first and then use the scripts to setup the S2S certificate and upload the app to your app catalog. If you have more than one app catalog, you'll see scripts for each. If you can't run AppDeployment.exe, use the second or third approaches to deploy the app.

You can deploy the app in three ways:

  1. Run AppDeployment.exe (located in the Installation folder of the downloaded product) on all SharePoint machines. This is the recommended approach.
  2. Run AppDeployment.exe to generate environment-specific scripts on one SharePoint machine, and then use those scripts to deploy the app to other environments using the files included in the K2 for SharePoint Application Deployment.exe (also located in the Installation folder of the downloaded product).
  3. Copy K2 for SharePoint Application Deployment.exe to your SharePoint server. If you can't run executables on your SharePoint server, run it on another machine and then copy the extracted folder to the SharePoint server. Then copy into the same folder the example Denallix scripts (see Downloads), and modify the script values to fit your environment. Then run the scripts in the following order:

      1. SetupS2S-[siteURL-port].ps1
      2. UploadApp-[siteURL-port].ps1

To run the first script from the command prompt, use this syntax:

C:\>powershell -executionPolicy bypass -noexit -file ".\SetupS2S-[siteURL-port].ps1"

Updating Script Values

You may need to update values in the scripts to reflect your environment before running them. Look for these constants at the top of the script. In the S2S script, there are other constants that you should not change.



  • $appFullPathName="C:\Program Files (x86)\K2 blackpearl\K2 smartforms Setup\SharePoint On-premises\K2 for SharePoint.app"
  • $appCatalogSiteUrl="https://portal.denallix.com/sites/AppCatalog"
  • $appImagePath="C:\Program Files (x86)\K2 blackpearl\K2 smartforms Setup\SharePoint On-premises\..\App Images"