SharePoint Pages - Break inheritance and remove groups using PowerShell

Brass Contributor

Hi all,

 

I've been trying to figure out this problem for a while now.  I have a SharePoint site template that I've applied.  The template creates all the pages and lists that we need.  For each new site using that template, I'd like to be able to run a script against to create custom groups and give them the correct roles for the lists and pages. 

 

I've been able to use PnPOnline to create all the groups, and assign the right permissions.  Since by default they get applied everywhere, the 2nd part of my script goes and removes the groups from the lists that they are not supposed to access.  This part works great.  What I am stuck on is doing the same thing with pages.  Some pages we don't want certain groups to get into but I'm have a hard time figuring this piece out through PowerShell.  Seems like it's possible with lists and document libraries but I can't find any similar commands for the pages themselves.

 

Any suggestions?

 

Thanks.

 

0 Replies