Export Yammer group members to a .csv file

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

Any member of your Yammer network can export the information for public groups. For private groups, only members of the group can export the membership list.

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

Step 1: Find the group ID

The group ID identifies the Yammer group. 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 the PowerShell script

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

Step 5: Open the .csv file with Excel

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

Step 1: Find the group ID

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

  2. Select a group.

  3. Look in the browser's address bar, and copy the value for feedId to your NotePad file. For example, in the following URL, you would copy the value 1172163.

    https://www.yammer.com/contoso.com/#/threads/inGroup?type=in_group&feedId=1172163

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.

    • Suppport 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

  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 | 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 abut finding Windows PowerShell, see Finding PowerShell in Windows 10, 8.1, 8.0 and 7.0

  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 can be found in the directory in which you ran the PowerShell commands.

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

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.

×