Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting UK – HostForLIFE.eu :: How to Get Group Users From SharePoint Site Using PnP Powershell
In this blog, we are going to see how to get the list of available groups and users from SharePoint site using PnP PowerShell.
The below PowerShell command retrieves all the SharePoint Groups from the SharePoint site and its users with users count for the group.
Get-PnPGroup PnP PowerShell cmdlet gets the SharePoint Groups from the SharePoint site collection.
1 2 3 4 |
PS:> $cred = Get-Credential PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred PS:> $groups = Get-PnPGroup | Select-Object Title,Users PS:> $groups | format-table @{Expression = {$_.Title};Label='Group'},@{Expression = {$_.Users.Title};Label='Users'},@{Expression = {$_.Users.Count};Label='UsersCount'} |
And here is the output:
Print article | This entry was posted by Peter on October 26, 2017 at 5:57 am, and is filed under European SharePoint 2013 Hosting. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |