Want to automate installing apps to SharePoint? Well, you’re in the right place!
When one of our customers purchases the Encodian PDF Converter for SharePoint Online, one of the first questions they ask is how to automate a SharePoint app’s deployment to multiple sites and webs within their SharePoint Online tenancy. As this was a standard requirement, we’ve produced a set of PowerShell scripts to enable you to do just that.
NOTE: These scripts are configurable, so they will work to automate the deployment of any SharePoint app within a SharePoint Online tenancy.
The steps in this article assume that your SharePoint Online tenancy has an App Catalog site and that the ‘Encodian PDF Converter for SharePoint Online’ application package or the application package you want to deploy has been added to the App Catalog.
To create the SharePoint App Catalog, follow steps 1 & 2 in this Microsoft support article and add the application package you want to deploy.
You can also download the ‘Encodian PDF Converter for SharePoint Online application package‘.
Attached to this article are two PowerShell scripts. Please note the file extension of the scripts will need to change to ps1
To execute these scripts in Windows PowerShell, the following packages are required.
Windows Management Framework 5.1
Open EncodianGetAppSites.ps1 and set values for the following parameters:
Once updated, execute EncodianGetAppSites.ps1. The user will be prompted for credentials requiring tenant administration rights to execute successfully.
The generated .csv will contain the Name and URL of all sites and sub-sites alongside a Status column. To install the app on a site or sites, enter the word “New” in the status column for that site.
Entries within the CSV file can be amended, deleted or new entries added as required.
Open EncodianDeployApp.ps1 and set values for the following parameters, which should be the same values as those specified in the first script
Once updated, execute EncodianDeployApp.ps1, and the app will be installed to the sites indicated by the “New” status in the .csv.
Please note if the same CSV file is used for subsequent installations, the “New” status should be removed from sites where the app has already been installed.
Managing Director