Unattended K2 for SharePoint App Deployment

This topic describes K2 for SharePoint App Deployment after an Unattended Installation. For detailed information on Unattended Installation, see the topic Unattended Installations.

Although you can use the K2 Setup Manager to generate the unattended installer XML file, to deploy the app to SharePoint you need to execute a Powershell script which performs necessary actions after the unattended installation is complete. Generate this script using the command: AppDeployement.exe /output:”filename”. Running this command starts the user interface where you enter information used to generate the script.

Before generating the script, you must have the Webservice URL ($webServiceEnvFieldDefaultUrl in the PowerScript example below) available. Find the URL in the XML file generated for the unattended install, at the following tag:

  • Webservice URL = [PRIMARY_WORKSPACE] (this is the default web service URL)

After generating the script, the [WEBSERVICE_URL] replace the token in it with the value of the [PRIMARY_WORKSPACE] token from the unattended XML file. The $issuerName variable must also be set after installing K2 in the environment. The value will look as follows:
$issuerName="K2-[SHAREPOINT_HIGHTRUST_ISSUER_ID]"

Replace the actual value for [SHAREPOINT_HIGHTRUST_ISSUER_ID] in the script. Retrieve the value from the K2 database by running the following query:

Copy

Retrieve the value

SELECT [VariableValue]
FROM [K2].[HostServer].[Configuration]
WHERE [VariableToken] = '[SHAREPOINT_HIGHTRUST_ISSUER_ID]'

Substituting the returned value for [SHAREPOINT_HIGHTRUST_ISSUER_ID] in the script will look similar to the following (but your value will be different):

$issuerName="K2-af818a1f-9c0f-4486-969f-da752a9f07b6"

Execute the generated Powershell script on all web front-ends to deploy the app. This script is stored in the installation folder with AppDeployment.exe if no file path is supplied (e.g. /output:”C:\MyUnattendedInstall\AppDeployement”), with the following file name:
AppDeployment-[your SharePoint site-port].ps1 (e.g. AppDeployment-portal.denallix.com-443.ps1)

See the Microsoft article on adding apps for SharePoint to a SharePoint 2013 site using Powershell for more information.
See the SharePoint 2013 Health Check and App Deployment Script article at the K2 Knowledge Center for more information on the scripts.