Ramon Torras


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

We want to install one SharePoint app 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.

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