Thanks for you time reading this. We are a Technical School that's using Sharepoint 365 as way to collect files and resources. We have to open a Sharepoint to each class and I'm compiling a Powershell script to be easier... When added a Site lets say "Class.ABC", the system also creates a group called "[email protected]" (without the dot) and through the script I add the students to the group. I'm using PNP.Powershell. One example:
Add-UnifiedGroupLinks –Identity "[email protected]" –LinkType "Members" –Links "[email protected]"
The problem is this group "[email protected]" is put in the "Members" group of the site by default, and therefore with contribute permissions. I want to change this group to "Visitors" of the site.
I've try this:
Add-PnPGroupMember -LoginName "[email protected]" -Identity "Visitors of Class.ABC"
Remove-PnPGroupMember -LoginName "[email protected]" -Identity "Members of Class.ABC"
But it didn't work as they work only with users not groups!
Is there any way to accomplish this?
Thanks a lot for your kind help. I'm not very good at Powershell, so please be gentle! ;)