Retrieve and export Office 365 Group Members (Part01)

Members of an Office 365 group can retrieved and exported in to a CSV file using Office command-line capabilities.

9

I recently had an requirement in a large enterprise setup to retrieve the members list of specific set of top level groups and export them in to a CSV file for a auditing purpose. This could be a common requirement, hence here it goes as a quick blog.

We will cover up two scenarios here.

  1. Retrieve and export members of an specific Office 365 group (Part01)
  2. Retrieve and export members of all Office 365 groups (Part 02)

Let’s cover up the 1st scenario. Just log in to Office 365 portal and head on to Admin Center page –> Groups –> click on the respective group and copy the group mail

10

Now let’s run PowerShell as an Administrator and make sure the execution policy is set to remote sign (if you haven’t yet, run this on the device you are going to do this task – set-executionpolicy remotesigned)

Here are the next few lines piece by piece. Also I have given the full script of the whole thing at the end.

$Credential = Get-Credential

1

Enter the Admin credentials for your tenant here.

11

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection

2

Import-PSSession $Session -DisableNameChecking

3

Import command might take a few seconds just to load up the modules as shown below.

12

Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member

4

Now, replace the “Identity” parameter here and run this line.

Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member

5

And here’s the command to export what we retrieved. Again, replace the <Identity> and <Path> here before running.

Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member | Select DisplayName,PrimarySmtpAddress | Export-CSV "C:\Exports\MembersList.csv" -NoTypeInformation

6

And, after you running the last line, you should now be able to see the CSV file created under the given path.

7

Just open it and it should have all the entries as shown below in my example.

8

Here’s the full script of the same thing. You can run it all at once as well.

### Get O365 Credentials
$Credential = Get-Credential
   
### Provision the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection
   
### Import session
Import-PSSession $Session -DisableNameChecking
 
### Retrieve Members of Office 365 Group
Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member
  
### Remove the session 
Remove-PSSession $Session

### Export
Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member | Select DisplayName,PrimarySmtpAddress | Export-CSV "C:\Exports\MembersList.csv" -NoTypeInformation

DISCLAIMER NOTE: This is an enthusiast post and is not sponsored by Microsoft or any other vendor. Please do not copy/duplicate the content of the post unless you are authorized by me to do so.

### Get O365 Credentials
$Credential = Get-Credential
   
### Provision the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection
   
### Import session
Import-PSSession $Session -DisableNameChecking
 
### Retrieve Members of Office 365 Group
Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member
  
### Remove the session 
Remove-PSSession $Session

### Export
Get-UnifiedGroup -Identity "InternalIT@mantoso.onmicrosoft.com" | Get-UnifiedGroupLinks -LinkType Member | Select DisplayName,PrimarySmtpAddress | Export-CSV "C:\Exports\MembersList.csv" -NoTypeInformation
Advertisement

Apply your custom helpline contact details in Office 365

Adding contact details of your support center will doubtlessly help users to promptly obtain the necessary support. Office 365 allows you to customize the organizational level details in the global settings and the help desk details is one of them.

helpline

To customize the Office 365 “Help”, follow these simple steps.

Sign in to Office 365 as an Admin and direct to –> Admin Center –> In the Office 365 admin center, Click on Settings –> Organization profile

1

Scroll down till you see the following area and hit “Edit”

2

Enable the “Help Desk Card” here and “Save” it.

3

Now that you have enabled it, you can add the details as shown below (well, it has to be your organization’s details of course !) and hit “Save” once done.

4

Sometimes, it will take a few seconds this message to appear after saving so give it a moment and close the message.

5

Now, If you log-out and log-in again, you will notice that the change have applied under the “Help” bar.

6

All new search experience in Office 365 will boost productivity

website-online-presence-illustration-illustration_53876-40424

Unified and personalized search will surely enhance the productivity for all Office 365 users as it was announced at Microsoft Ignite last year.

1

Microsoft Graph and AI powered new interface is expected to supercharge your day to day experience with Microsoft tools. You will notice a significant change when you log in to office.com as these changes are currently being shipped to tenants. It has landed in my Targeted Release Tenant and i noticed the changes few days ago.

2

Global search is now in the suit bar and the search result experience is consistently same across the entire Office 365 platform. Also, the all new Office Apps icons are reflected in the Waffle Menu. Just a few more apps like Dynamics and Flow icons to have a new look and they will soon be updated too.

Results are personalized by default: As soon as you click on the search box, search engine is intelligent to display a prominent result in a dropdown based on your recent activities and engagements across the organization.

Search results will include global results across the organization. Through this update you will also find excel and other files.

search box is now capable of commanding the application that you are in. You no longer need to drill down through tool bars to access commands, instead type the feature name in the application to get the list of suggested actions.


Mobile App Updates:

The new SharePoint mobile app will reflect these enhancements as well. Search experience is a key element which has been improved and it will list down common questions, personalized results, and frequent searches of your organization.