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 "ClassABC@acme.org" (without the dot) and through the script I add the students to the group. I'm using PNP.Powershell. One example:
Add-UnifiedGroupLinks –Identity "ClassABC@acme.org" –LinkType "Members" –Links "Student.firstname.lastname@example.org"
The problem is this group "ClassABC@acme.org" 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 "ClassABC@acme.orgt" -Identity "Visitors of Class.ABC" Remove-PnPGroupMember -LoginName "ClassABC@acme.org" -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! ;)