Requirement

This is another blog from my training experience on SharePoint 2013 and SharePoint Online. In this blog, I will show two different scenario, where we need users from SharePoint online site using PowerShell.

  1. Get all users in a specified Group.
  2. Get a specific user by his/her login name.

Syntax for 1st Scenario:

Output:

After running the above cmdlets, we will see get all available users of a specified SharePoint Security Groups in SharePoint Online site as shown in following figures.

Get GroupUsers

Syntax for 2nd Scenario:

Output:

After running the above cmdlets, we will see get the specified user by its log in name in SharePoint Online site as shown in following figures.

byLoginName

Hope this blog will help in some cases. Thank You.