# Export the participants of a Microsoft Teams meeting



Export the participants of a Microsoft Teams meeting as a CSV file

Published by Guillaume Meyer  in 26 minutes, tagged as teams export meeting participants microsoft

Share This Post

Please select how you want to share this post:





Warning

This solution is a quick and dirty hack to export the participants of a Microsoft Teams meeting when you don't have administrative access, and does not intend to be used in production environments.
As of today, the following properties are exported:

  • Display name
  • UPN

# Usage

  1. Open your meeting in a web browser
  2. Click on the participants list to open the popover

You should see something like:

Microsoft Teams meeting participants

  1. Open your browser console with CTRL + SHIFT + I
  2. Copy and paste all the content of this script to the console
$(function() {
  
  // **************
  // Initialization
  // **************
  const csvFileName = 'team-meeting-participants-export.csv'
  const csvDelimiter = ','
  const csvHeader = 'Display Name' + csvDelimiter + 'UPN' + '\r\n' // CSV header row
  let csvContent = csvHeader // Initialize CSV content
  const participantsLength = $('.participant-title').length // Number of visible participants

  // *****************************
  // Iterate over each participant
  // *****************************
  for (let index = 0; index < participantsLength; index++) {
    // Extract the display name (trimming extra spaces and line breaks)
    const displayName = $('.participant-title').eq(index).text().replace(/\s+/g,' ').trim().replace(/\n/g, " ")
    // Extract upn
    const upn = $('.popover-content .person-profile img').eq(index).attr('upn')
    // Append to the CSV content
    const csvRow = displayName + csvDelimiter + upn + '\r\n'
    csvContent += csvRow
  }

  // Debug the export to console
  console.info(participantsLength + ' participants exported:')
  console.info(csvContent)

  // **********************************************************
  // Dynamically generates a CSV file and triggers its download
  // **********************************************************

  // Create a dynamic "a" tag
  var element = document.createElement('a')
  // Set href link with content
  element.setAttribute(
    'href',
    'data:application/json;charset=utf-8,' + encodeURIComponent(csvContent)
  )
  // Set downloaded file name
  element.setAttribute('download', csvFileName)
  // Hide the elemement and add it to the page
  element.style.display = 'none'
  document.body.appendChild(element)
  // Launch download
  element.click()
  // Remove element
  document.body.removeChild(element)
})

TIP

See the up to date source code from this GitHub Gist

  1. Type Enter
  2. The CSV file download should start automatically
  3. Enjoy!