Currently I am running into an issue. I have an app installed from the SharePoint store "Docusign" and it is at the top level site collection. I have to manually go to every subsite and click the gear and choose add an app, then choose docusign and then click Trust It. I want to enable this "app" on all the subsites of said site collection with a Powershell script/command.

Site Collection 1 Where app was initially added

Subsite1 Subsite2 ....etc I am very new to powershell and I have tried to copy and paste some scripts together to get this to work but keep hitting a wall. Any help on this would be greatly appreciated or should I approach this a different way?

$app = new-object -com shell.application $ie=$app.windows() $ie=$ie | ?{$_.locationurl -match "SiteCollectionURL"}

if($ie -ne $null) { Write-host Connected $url='https://test.sharepoint.com/sites/Site/subsite5/_layouts/15/storefront.aspx?source=%2Fsites%2FSite%2Fsubsite5&sname=subsite5#qry=%22Docusign%20for%20SharePoint%22,vw=AppDetailsView,app=WA104218069,clg=0' $ie.Navigate($url) Start-Sleep -s 10

$addItButton=$ie.Document.body.getElementsByTagName('button') |? {$_.value -match 'Add' }
if($addItButton.disabled -eq $false)
    Start-Sleep -Seconds 5

//The above code successfully clicks on Add button but when the pop up comes, the above code fails to click on Trust It button

  • What "wall" are you hitting? What is the approach you take, and what error you are encountering when executing it?
    – RuneBH
    Nov 10, 2020 at 13:54
  • Please find my updated query. I have included my code as well. Nov 11, 2020 at 4:01
  • Hi @SB_LoneWolf - It sure looks like javascript and not Powershell from your snippet above. With the same user that is executing the script have you tried to manually install and trust the app? It could be lack of of permissions. Also, depending on the scenario, you could consider trusting the app on tenant level and thus not having to trust it everytime you install it on a site collection.
    – RuneBH
    Nov 15, 2020 at 21:49

1 Answer 1


For managing apps tenant level, you will need to first create a SharePoint app catalog. Then you can manage the app deployment there. Here are tutorials about it, have a check on it. And just like you said, after the deployment, still you will need to add the app by hand(Trust it and add it). After deployment in app catalog, it makes the app available on those sites.



  • I have already Deployed with the help of App Catalog. I just want to automate process of trusting app at Site and Subsites level. Nov 11, 2020 at 4:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.