As you know, each Office 365 Group we create in an Office 365 tenant has its own SharePoint Online (SPO) Site Collection to store all the Group information. This Site Collection is very limited in terms of the functionality provided by the user interface…but you can use SPO Client Side Object Model and REST API to do common Site Collection Operations as I will show you in this article and future articles to come. In Today’s article I will be using some of the scripts I have already wrote and published in both my GitHub repository and the TechNet Script Center Gallery.
First, using REST and CSOM we can easily get the Lists and Document Libraries existing on a Groups Site. For this task, I have used the following script: How to Get all the Lists in a SharePoint Online Site using REST. Once you run the Script in PowerShell ISE, you will get the Lists and Document Libraries on the Groups Site.
Second, we can get also with CSOM the SharePoint Groups and users per Group using the following script: How to get all the users in a SharePoint Group in a SharePoint Online Site. Note that in this case once you execute the script, you can verify that the Group is part of the standard SharePoint Owners Group
Finally, lets add a new user to a SharePoint Group in the site using the following script: How to add users to a SharePoint Group in SharePoint Online. After executing the script, you can check the user is added to the Group using againd the Script: How to get all the users in a SharePoint Group in a SharePoint Online Site
What I have found interesting on adding users to a Group on the Group Site is that you can grant access to any user to that site no matter if the user is a member of the Group or not as you can see in the following screenshot: