title: Fetch user roles and permissions for SharePoint Online using PnP
body: <p>I'm looking to fetch the SharePoint group roles and permissions using SharePoint-PnP for the Site Collection.</p>
  
  <p>I was able to retrieve the SharePoint Groups using <code>$Web.SiteGroups</code> but failed to find the properties for fetching Roles and Permissions.</p>
  
  <p>Using the following code snippet to retrieve Group ID, Title and Description.</p>
  
  <pre><code>#Import the required DLL
  Import-Module 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll'
  Import-Module 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
  #OR
  #Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll'
  #Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
  
  #Mysite URL
  $site = 'https://test.test.com/sites/sitename'
  
  #Admin User Principal Name
  $admin = 'LoginID'
  
  #Get Password as secure String
  #$password = Read-Host 'Enter Password' -AsSecureString
  $password = Read-Host -Prompt "Enter password" -AsSecureString 
  
  
  #Get the Client Context and Bind the Site Collection
  $context = New-Object Microsoft.SharePoint.Client.ClientContext($site)
  
  #Authenticate
  $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin , $password)
  $context.Credentials = $credentials
  
  $list = $context.Web.Lists.GetByTitle('ListName')
  
  $web = $context.Web
  $context.Load($web)
  $context.Load($web.SiteGroups)
  $context.Load($list)
  $context.ExecuteQuery()
  
  foreach($x in $web.SiteGroups)
  {
      Write-Host $x.Id
      Write-Host $x.Title
      Write-Host $x.Description
  }
  $list.Update()
  </code></pre>
  
  <p>I don't have the option to go with the SharePoint Online DLL as I don't have the access to run the script as tenant administrator, but site collection administrator.</p>
  
  <p>It would be helpful if this at all can be achieved using PnP ? Any other solutions are welcome.</p>