How to Add an App to SharePoint Online Site using PowerShell?

Requirement: Add an App to SharePoint Online Site.

How to an App from App Catalog to SharePoint Online Site?
To add an app from SharePoint Online app catalog site, do the following:
  • Login to your SharePoint Online site >> Click on Settings gear >> Add an App
  • Click on "From Your Organization" from the left navigation
  • Pick the app from your app catalog. E.g. I've picked my custom app "File Controller"
    add app from app catalog site
  • You may get a prompt to trust the app: Click on "Trust It" to proceed adding app to your SharePoint Online site.
    add an app to site in sharepoint online
You have to wait for a few moments while SharePoint is adding the App to the site. Wait and Refresh.

Add an App from SharePoint App Store
To add an app from SharePoint App Store to SharePoint Online site, do the following:
  • Login to your SharePoint Online site >> Click on Settings gear >> Add an App
  • Click on "SharePoint Store" from the left navigation
  • Apps in the app store may be free, or must be purchased. Search and pick the app from market place. E.g. I've picked "Adobe Sign for SharePoint Online"
  • Click on "Add IT" and follow the wizard to deploy the App to your site.
    add app to sharepoint online from market place
The app is added for use in your site from within the Your Apps page. Added app extends SharePoint functionality/adds web part as its intended purpose.

Add an App to Multiple Sites in SharePoint Online through App Catalog:
You can add an app to multiple sites from App catalog site without requiring users to add it.
  • Login to SharePoint Online App Catalog site as a administrator
  • Click on Settings >> Site contents. Make sure you are in classic UI by clicking on "Return to classic SharePoint" link at the bottom-left.
  • Select the ellipsis (...) next to the app you want to deploy to other sites, and select the ellipsis (...) again in the popup window. Select "Deployment".
    deploy app to all sites from app catalog
  • Enter the URL of the site collections to deploy the app to and click Add. You can also select  managed paths to deploy or select specific site templates. Click OK to start adding the app to sites under selected criteria.
    bulk deploy apps from sharepoint online app catalog
  • Click on "Trust It" button to proceed adding the app.
  • The app will de added to selected sites and will show up in the site contents page.

PnP PowerShell to Install an App to SharePoint Online Site:
We can also an add app to SharePoint Online site from app catalog using PnP PowerShell script.
#Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/Legal"
$AppName = "Modern Script Editor web part by Puzzlepart"

#Connect to SharePoint Online App Catalog site
Connect-PnPOnline -Url $SiteURL -UseWebLogin

#Get the App from App Catalog
$App = Get-PnPApp -Scope Tenant | Where {$_.Title -eq $AppName}

#Install App to the Site
Install-PnPApp -Identity $App.Id
You need site owner permissions to be able to add apps to SharePoint Online! To add apps to SharePoint Online App catalog site use: How to Add an App to SharePoint Online App Catalog Site?

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.