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)
{
$addItButton.click()
Start-Sleep -Seconds 5
$trustIt=$ie.Document.IHTMLDocument3_getElementById('ctl00_PlaceHolderMain_BtnAllow')
$trustIt.click()
}
//The above code successfully clicks on Add button but when the pop up comes, the above code fails to click on Trust It button