0

We have a manual process at the moment where we have assigned "Content Owners" to out Sites/Sub-Sites. Content Owners, essentially have no greater permissions than regular users, but our Governance Team have assigned them to make the decision as to whether a User can access a resource within the Site Collection or not.

The Content Owner is assigned via a Web Part within the HomePage. Is there a way to pick up this data within a Script. I will be cycling through all Sites/Sub-Sites across my tenant. I know how to go through all Sites/SubSites, but just the data within the specific page isn't available.

enter image description here

The other method I had in mind, which will require some development, is to create Dummy SharePoint Groups to hold this data. If anyone can think of another way, that would be much appreciated.

Thank you

2
  • Another, possibly more sustainable way of doing this is to place this data within the Site Description and pick this data up from there. This is since the Data isn't consistent in the Pages. Some times it is displayed as above and sometimes as plain text. – Quasam Amanat Oct 15 '19 at 8:42
  • Still would love to know if there is possibilities of picking text/web part data would from within Site pages? – Quasam Amanat Oct 15 '19 at 8:43
0

I understand you want to get web part data from a modern page. if so, you could have a try below cmdlets:

Or

$page = Get-PnPClientSidePage -Identity Home.aspx    
$webpart = $page.Controls | ? {$_.InstanceId -eq "416a4c58-61fc-4166-aa19-1099fad50545"}  
$webpart.PropertiesJson  

You may check its data through workbench:

enter image description here

PnpJs also provided the similar feature:

More reference:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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