Export Yammer community members to a .csv file

Export Yammer community members to a .csv file

Note: This topic describes a feature in new Yammer. For information on using this feature in classic Yammer, see Export Yammer group members to a .csv file.

You can export Yammer community members names and email addresses to a .csv file. This is useful if you want to see if anyone is missing from the community, invite all community members to another community, or contact members by email.

Any member of your Yammer network can export the information for public communities. For private communities, only members of the community and network admins can export the membership list.

Note: If your community is Microsoft 365-connected and you have access to the Azure Active Directory (Azure AD) portal, then you could follow the steps in Bulk download members of a group in Azure Active Directory instead of the steps below.

This process below requires using Windows PowerShell. It looks complicated but takes just a few minutes to complete.

Step 1: Find the community's group ID

The group ID identifies the Yammer community. You need it for the PowerShell script.

Step 2: Find your token

Your token is an encrypted version of your account and password. You need it for the PowerShell script.

Step 3: Create your PowerShell script

Save the sample code in a file, and replace the values for the group ID and token.

Step 4: Run your PowerShell script

Change directories to the folder where you want the .csv file and paste your script into PowerShell.

Step 5: Open the file with Excel

Use the full-name and email columns to get the list of members.

Step 1: Find the community's group ID

  1. In your browser, go to https://www.yammer.com.

  2. Select a community.

  3. Look in the address bar and copy the group base 64 encoding.

    This is after groups/ and before /all in the address bar.

  4. After copying this base 64 encoding, use an online tool to decode base 64.

    For example, the base 64 encoding in the following URL would be JfdHlwZSI6Ikdyb3VwIiwiaWQiOiI5NzM0ODQ4NTEyIn0

    https://web.yammer.com/main/groups/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI5NzM0ODQ4N0TEyIn/all

  5. Running the base 64 decoder will give: {"_type":"Group","id":"9734848512"} and therefore the group ID is 9734848512.

Yammer community feed ID

Step 2: Find your token

Warning: Do not share your token with anyone else. It can be used to access your Yammer account.

  1. In a browser, go to https://www.yammer.com/client_applications.

  2. Click Register New App.

    • Application name: Since you won't be using this app for anything except getting your token, name it whatever you'd like. The application name must be unique.

    • Organization: Enter your company name.

    • Support email: Enter your work email address.

    • Website: Enter your company's website.

    • Redirect URI: Enter https://www.yammer.com.

    Details page for creating a new Yammer app

  3. In the Keys and token section, click Generate a developer token for this application.

    Yammer app page showing link to get token

    The token is shown at the bottom of the Keys and token page. It is shown blurred in the previous picture.

    The token can be used to access Yammer, so do not share it.

  4. Copy the token to a Notepad file.

    Yammer app page showing token

Step 3: Create your PowerShell script

Warning: Do not share this script after you enter your token. Your token can be used to access your Yammer account.

  1. Copy the following code into a Notepad file.

    $GroupId=group_id_value
    
    $Token = "token_value"
    
    $Headers = @{ "Authorization" = "Bearer "+$Token }
      
    $GroupCycle = 1
    DO
    	{
    		$GetMoreGroupsUri = "https://www.yammer.com/api/v1/users/in_group/$GroupId.xml?page=$GroupCycle"
    		write-host ("REST API CALL : $GetMoreGroupsUri")
            [xml]$Xml = ((Invoke-WebRequest -Uri $GetMoreGroupsUri -Method Get -Headers $Headers).content)
            $YammerGroups += $Xml.response.users.user
            $GroupCycle ++
            $GroupCount += $Xml.response.users.user.count
    		write-host ("GROUPMEMBER COUNT : $GroupCount")
        }	
    	While ($Xml.response.users.user.count -gt 0)
    	 $YammerGroups | Where {$_} | Export-Csv "$GroupId.csv" -Delimiter "," 
      
    	
  2. In the first two lines of the script, replace the group_id_value and token_value with the results from steps 1 and 2.

Step 4: Run your PowerShell script

  1. Open Windows PowerShell. For information about installing Windows PowerShell, see Installing various versions of PowerShell.

  2. In PowerShell, change directories to the place you want the .csv file to be saved. For example, if you want the script to be stored in your Documents folder, and your user name is Joe, type:

    cd c:\users\joe\documents
  3. Copy your script from your NotePad file, paste it into PowerShell, and press Enter.

Step 5: Open the file with Excel

  1. Double-click the Excel file, which will have the name GroupID.csv, using the group ID from step 1.

    This file will be in the directory from which you ran the PowerShell commands.

  2. Use the full-name and email columns to get the list of members.

See also

Manage a community in Yammer

Manage Yammer community members

Customize a Yammer community

Join and create a community in Yammer

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×