How to install a SharePoint 2013 app with PowerShell Script using Server SharePoint Object model

We want to install one SharePoint app with PowerShell Script automatically in a site. Where could be interesting doing that?

In several cases, for instance when you are provisioning your site by code and you need to have the app installed, available and ready for the user.

All the samples that I have seen so far were related do this action but with the Client SharePoint Object model. Which could be useful when you are dealing with SharePoint online (O365) but what about if your SharePoint is on premises.

Power Shell give us the option to perform these actions programmatically: Install the app and Trust the app.

NOTE: Take care about the user who runs the script. It cannot be system account, otherwise the Install-SPApp command will fail. You should run the script with another user with enough privileges.

 

PowerShell Script
PowerShell Script

 

Here the PS goes. I hope it will help you when you are provisioning in SharePoint.

Never miss an update by following us and subscribing to our monthly newsletter!

Summary
Article Name
How to install a SharePoint 2013 app with PowerShell Script using Server SharePoint Object model
Description
We want to install one SharePoint application with PowerShell Script automatically in a site by using Server SharePoint Object model.
Author
Publisher Name
Atos Consulting CH
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *