Recognize team activity using the CLI for Microsoft 365

Published Aug 09 2021 08:41 AM 1,428 Views

The scenario

Not unlike the previous scenario the goal of this blog post is to identify the activities per team. We want to capture how active each team member is based on their actions within that specific team. We can use those activities to score each member and share the top active users to team. Potentially we could also consider out to other services like SharePoint as they might be active on files rather than using the chat functionality. Given that we want to identify those users within a timeframe the script should be able to handle activity within a timeslot.

Available metrics

The CLI for Microsoft offers a range of commands to work with teams, channels, and the data within Teams. As well as information for other services. So, the first step is to identify what data we need. For demo purposes we start with the following:

  1. Retrieve a single team
  2. Retrieve all channels
  3. Retrieve messages within a timeframe
  4. Get all Likes & replies, and of course likes per reply as well

If we do have that information, we score each interaction and group the results per team member. We can even add additional points if the initial post has a subject to promote the use of best practices in working with Teams. Once we have all that information, we can post to Teams using an adaptive card.

Microsoft 365 CLI Commands

Interacting with the CLI for Microsoft will be done using a set of basic commands:

  • m365 teams channel list to list all teams channels
  • m365 teams message list to list all messages within a channel. We will use a filter to get only messages in our desired time frame.
  • m365 teams message reply list to list all replies per message as the the message list or message get do not provide you the reply list.
  • m365 aad user get to get the display name for each user.
  • m365 adaptivecard send to send our results to Teams and present a score card for all team members.

The scripts

The script itself list all channels, loops through those channels and retrieves all replies. It constructs a new object that saves the UserID and per message type some additional details. Once that information is processed the results are group per user and sorted by the scores. Those results are then posted to Teams using an adaptive card.

 

For scoring the scenario uses the following ‘ranking’:

  • Each new posts is worth 2 points.
  • Each new post with a subject scores an additional 1 pointer.
  • Each reply counts as 1 point.
  • Each reaction (using the :thumbs_up: or ♥ icons) scores 0.5 points.

You can tweak those scores yourself if you like on line 77 to 80. Future samples might add SharePoint interactions as well.

 

 

 

 

 

$teamId = "<PUTYOURTEAMIDHERE>"
$webhookUrl = "<PUTYOURURLHERE>"
# You can get a delta of messages since the last 'n' days. Currently set to seven. You can go back a maximum of 8 months.
$date = (get-date).AddDays(-7).ToString("yyyy-MM-ddTHH:mm:ssZ")

$channels = m365 teams channel list --teamId $teamId --output json | ConvertFrom-Json
$results = @()
$scoreResults = @()

$channelCounter = 0;

foreach ($channel in $channels) {

    $channelCounter++;
    Write-Output "Processing channel... $channelCounter/$($channels.Length)"

    $messages = m365 teams message list --teamId $teamId --channelId $channel.id --since $date --output json | ConvertFrom-Json

    $messageCounter = 0;

    foreach ($message in $messages) {
        $messageCounter++
        Write-Output "Processing message ... $messageCounter/$($messages.Length)"

        # Skip messages that are created with an application (bots / adaptive cards)
        if ($null -ne $message.from.user.id) {
            $results += [pscustomobject][ordered]@{
                Type       = "Post"
                Details    = $message.reactionType
                UserId     = $message.from.user.id
                HasSubject = $($null -ne $message.subject)
            }
        }

        # Process all likes and comments on the initial message
        foreach ($reaction in $message.reactions) {
            $results += [pscustomobject][ordered]@{
                Type    = "Reaction"
                Details = $reaction.reactionType
                UserId  = $reaction.user.user.id
            }
        }

        $replies = m365 teams message reply list --teamId $teamId --channelId $channel.id --messageId $message.Id --output json | ConvertFrom-Json

        foreach ($reply in $replies) {
            # Skip replies that are created with an application (bots)
            if ($null -ne $message.from.user.id) {
                $results += [pscustomobject][ordered]@{
                    Type   = "Reply"
                    UserId = $reply.from.user.id
                }
            }

            # Process all likes and comments on the reply message
            foreach ($reaction in $reply.reactions) {
                $results += [pscustomobject][ordered]@{
                    Type    = "Reaction"
                    Details = $reaction.reactionType
                    UserId  = $reaction.user.user.id
                }
            }

        }
    }
}

# Group the results per user
$resultsGrouped = $results | Group-Object -Property UserId

#Score per user
foreach ($teamsUser in $resultsGrouped) {
    $user = m365 aad user get --id $teamsUser.Name --output json | ConvertFrom-Json

    # Count points
    # Each  post is two points, 1 extra point awarded for each Post with Subject
    # Each reply 1 and each reaction 0.5
    $score = (($teamsUser.Group | Where-Object { $_.Type -eq "Post" }).Count * 2)
    $score += (($teamsUser.Group | Where-Object { $_.HasSubject }).Count)
    $score += ($teamsUser.Group | Where-Object { $_.Type -eq "Reply" }).Count
    $score += (($teamsUser.Group | Where-Object { $_.Type -eq "Reaction" }).Count / 2)

    $scoreResults += [pscustomobject][ordered]@{
        DisplayName       = $user.displayName
        UserPrincipalName = $user.userPrincipalName
        Score             = $score;
    }
}

# Sort our score report based on the score
$scoreResults = $scoreResults | Sort-Object { $_.score } -Descending

#Construct adaptive card
$title = "‌‌ Most active team members"
$scoreJson = '{   \"title\": \"‌‌ '+$($scoreResults[0].DisplayName)+'\",   \"value\": \"' + $($scoreResults[0].score) + '\"   }'

if($scoreResults[1]){
    $scoreJson += ',{   \"title\": \"‌‌ '+$($scoreResults[1].DisplayName)+'\",   \"value\": \"' + $($scoreResults[1].score) + '\"   }'
}
if($scoreResults[2]){
    $scoreJson += ',{   \"title\": \"‌‌ '+$($scoreResults[2].DisplayName)+'\",   \"value\": \"' + $($scoreResults[2].score) + '\"   }'
}

$card = '{ \"type\": \"AdaptiveCard\", \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\", \"version\": \"1.2\", \"body\": [  {  \"type\": \"TextBlock\",  \"text\": \"' + $($title) + '\",  \"wrap\": true,  \"size\": \"Medium\",  \"weight\": \"Bolder\",  \"color\": \"Attention\"  },  {  \"type\": \"TextBlock\",  \"wrap\": true,  \"text\": \"Week ' + $(get-date -UFormat %V) + '\",  \"fontType\": \"Default\",  \"size\": \"Small\",  \"weight\": \"Lighter\",  \"isSubtle\": true  },  {  \"type\": \"FactSet\",  \"facts\": [   ' + $scoreJson + '  ]  } ] }'

m365 adaptivecard send --url $webhookUrl --card $card

 

 

Executing the script will tell you the progress as it can take a while to process all channels and messages depending the size of your team.

team-champion-script.png

Once the script is finished you can expect an adaptive card showing the score for that team. If no top 3 can be constructed it will only show the top 1 or 2, and their score.

 

team-champion-result.png

 

Hopefully this sample provides some insights in how you can track activity and recognize the contributions team members make per team. I love playing around with samples like this as its a great way to learn the commands and see what value you can add based off data and information already present in your Microsoft 365 tenant.

%3CLINGO-SUB%20id%3D%22lingo-sub-2626789%22%20slang%3D%22en-US%22%3ERecognize%20team%20activity%20using%20the%20CLI%20for%20Microsoft%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2626789%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--383752651%22%20id%3D%22toc-hId--383752623%22%3EThe%20scenario%3C%2FH2%3E%0A%3CP%3ENot%20unlike%20the%20previous%20scenario%20the%20goal%20of%20this%20blog%20post%20is%20to%20identify%20the%20activities%20per%20team.%20We%20want%20to%20capture%20how%20active%20each%20team%20member%20is%20based%20on%20their%20actions%20within%20that%20specific%20team.%20We%20can%20use%20those%20activities%20to%20score%20each%20member%20and%20share%20the%20top%20active%20users%20to%20team.%20Potentially%20we%20could%20also%20consider%20out%20to%20other%20services%20like%20SharePoint%20as%20they%20might%20be%20active%20on%20files%20rather%20than%20using%20the%20chat%20functionality.%20Given%20that%20we%20want%20to%20identify%20those%20users%20within%20a%20timeframe%20the%20script%20should%20be%20able%20to%20handle%20activity%20within%20a%20timeslot.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-2103760182%22%20id%3D%22toc-hId-2103760210%22%3EAvailable%20metrics%3C%2FH2%3E%0A%3CP%3EThe%20CLI%20for%20Microsoft%20offers%20a%20range%20of%20commands%20to%20work%20with%20teams%2C%20channels%2C%20and%20the%20data%20within%20Teams.%20As%20well%20as%20information%20for%20other%20services.%20So%2C%20the%20first%20step%20is%20to%20identify%20what%20data%20we%20need.%20For%20demo%20purposes%20we%20start%20with%20the%20following%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ERetrieve%20a%20single%20team%3C%2FLI%3E%0A%3CLI%3ERetrieve%20all%20channels%3C%2FLI%3E%0A%3CLI%3ERetrieve%20messages%20within%20a%20timeframe%3C%2FLI%3E%0A%3CLI%3EGet%20all%20Likes%20%26amp%3B%20replies%2C%20and%20of%20course%20likes%20per%20reply%20as%20well%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EIf%20we%20do%20have%20that%20information%2C%20we%20score%20each%20interaction%20and%20group%20the%20results%20per%20team%20member.%20We%20can%20even%20add%20additional%20points%20if%20the%20initial%20post%20has%20a%20subject%20to%20promote%20the%20use%20of%20best%20practices%20in%20working%20with%20Teams.%20Once%20we%20have%20all%20that%20information%2C%20we%20can%20post%20to%20Teams%20using%20an%20adaptive%20card.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-296305719%22%20id%3D%22toc-hId-296305747%22%3EMicrosoft%20365%20CLI%20Commands%3C%2FH2%3E%0A%3CP%3EInteracting%20with%20the%20CLI%20for%20Microsoft%20will%20be%20done%20using%20a%20set%20of%20basic%20commands%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Em365%20teams%20channel%20list%20to%20list%20all%20teams%20channels%3C%2FLI%3E%0A%3CLI%3Em365%20teams%20message%20list%20to%20list%20all%20messages%20within%20a%20channel.%20We%20will%20use%20a%20filter%20to%20get%20only%20messages%20in%20our%20desired%20time%20frame.%3C%2FLI%3E%0A%3CLI%3Em365%20teams%20message%20reply%20list%20to%20list%20all%20replies%20per%20message%20as%20the%20the%20message%20list%20or%20message%20get%20do%20not%20provide%20you%20the%20reply%20list.%3C%2FLI%3E%0A%3CLI%3Em365%20aad%20user%20get%20to%20get%20the%20display%20name%20for%20each%20user.%3C%2FLI%3E%0A%3CLI%3Em365%20adaptivecard%20send%20to%20send%20our%20results%20to%20Teams%20and%20present%20a%20score%20card%20for%20all%20team%20members.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--1511148744%22%20id%3D%22toc-hId--1511148716%22%3EThe%20scripts%3C%2FH2%3E%0A%3CP%3EThe%20script%20itself%20list%20all%20channels%2C%20loops%20through%20those%20channels%20and%20retrieves%20all%20replies.%20It%20constructs%20a%20new%20object%20that%20saves%20the%20UserID%20and%20per%20message%20type%20some%20additional%20details.%20Once%20that%20information%20is%20processed%20the%20results%20are%20group%20per%20user%20and%20sorted%20by%20the%20scores.%20Those%20results%20are%20then%20posted%20to%20Teams%20using%20an%20adaptive%20card.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20scoring%20the%20scenario%20uses%20the%20following%20%E2%80%98ranking%E2%80%99%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EEach%20new%20posts%20is%20worth%202%20points.%3C%2FLI%3E%0A%3CLI%3EEach%20new%20post%20with%20a%20subject%20scores%20an%20additional%201%20pointer.%3C%2FLI%3E%0A%3CLI%3EEach%20reply%20counts%20as%201%20point.%3C%2FLI%3E%0A%3CLI%3EEach%20reaction%20(using%20the%20%3Athumbs_up%3A%20or%20%E2%99%A5%20icons)%20scores%200.5%20points.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EYou%20can%20tweak%20those%20scores%20yourself%20if%20you%20like%20on%20line%2077%20to%2080.%20Future%20samples%20might%20add%20SharePoint%20interactions%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%24teamId%20%3D%20%22%3CPUTYOURTEAMIDHERE%3E%22%0A%24webhookUrl%20%3D%20%22%3CPUTYOURURLHERE%3E%22%0A%23%20You%20can%20get%20a%20delta%20of%20messages%20since%20the%20last%20'n'%20days.%20Currently%20set%20to%20seven.%20You%20can%20go%20back%20a%20maximum%20of%208%20months.%0A%24date%20%3D%20(get-date).AddDays(-7).ToString(%22yyyy-MM-ddTHH%3Amm%3AssZ%22)%0A%0A%24channels%20%3D%20m365%20teams%20channel%20list%20--teamId%20%24teamId%20--output%20json%20%7C%20ConvertFrom-Json%0A%24results%20%3D%20%40()%0A%24scoreResults%20%3D%20%40()%0A%0A%24channelCounter%20%3D%200%3B%0A%0Aforeach%20(%24channel%20in%20%24channels)%20%7B%0A%0A%20%20%20%20%24channelCounter%2B%2B%3B%0A%20%20%20%20Write-Output%20%22Processing%20channel...%20%24channelCounter%2F%24(%24channels.Length)%22%0A%0A%20%20%20%20%24messages%20%3D%20m365%20teams%20message%20list%20--teamId%20%24teamId%20--channelId%20%24channel.id%20--since%20%24date%20--output%20json%20%7C%20ConvertFrom-Json%0A%0A%20%20%20%20%24messageCounter%20%3D%200%3B%0A%0A%20%20%20%20foreach%20(%24message%20in%20%24messages)%20%7B%0A%20%20%20%20%20%20%20%20%24messageCounter%2B%2B%0A%20%20%20%20%20%20%20%20Write-Output%20%22Processing%20message%20...%20%24messageCounter%2F%24(%24messages.Length)%22%0A%0A%20%20%20%20%20%20%20%20%23%20Skip%20messages%20that%20are%20created%20with%20an%20application%20(bots%20%2F%20adaptive%20cards)%0A%20%20%20%20%20%20%20%20if%20(%24null%20-ne%20%24message.from.user.id)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24results%20%2B%3D%20%5Bpscustomobject%5D%5Bordered%5D%40%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Type%20%20%20%20%20%20%20%3D%20%22Post%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Details%20%20%20%20%3D%20%24message.reactionType%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UserId%20%20%20%20%20%3D%20%24message.from.user.id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20HasSubject%20%3D%20%24(%24null%20-ne%20%24message.subject)%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%23%20Process%20all%20likes%20and%20comments%20on%20the%20initial%20message%0A%20%20%20%20%20%20%20%20foreach%20(%24reaction%20in%20%24message.reactions)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24results%20%2B%3D%20%5Bpscustomobject%5D%5Bordered%5D%40%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Type%20%20%20%20%3D%20%22Reaction%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Details%20%3D%20%24reaction.reactionType%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UserId%20%20%3D%20%24reaction.user.user.id%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%24replies%20%3D%20m365%20teams%20message%20reply%20list%20--teamId%20%24teamId%20--channelId%20%24channel.id%20--messageId%20%24message.Id%20--output%20json%20%7C%20ConvertFrom-Json%0A%0A%20%20%20%20%20%20%20%20foreach%20(%24reply%20in%20%24replies)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Skip%20replies%20that%20are%20created%20with%20an%20application%20(bots)%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24null%20-ne%20%24message.from.user.id)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24results%20%2B%3D%20%5Bpscustomobject%5D%5Bordered%5D%40%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Type%20%20%20%3D%20%22Reply%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UserId%20%3D%20%24reply.from.user.id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Process%20all%20likes%20and%20comments%20on%20the%20reply%20message%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20(%24reaction%20in%20%24reply.reactions)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24results%20%2B%3D%20%5Bpscustomobject%5D%5Bordered%5D%40%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Type%20%20%20%20%3D%20%22Reaction%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Details%20%3D%20%24reaction.reactionType%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UserId%20%20%3D%20%24reaction.user.user.id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%0A%23%20Group%20the%20results%20per%20user%0A%24resultsGrouped%20%3D%20%24results%20%7C%20Group-Object%20-Property%20UserId%0A%0A%23Score%20per%20user%0Aforeach%20(%24teamsUser%20in%20%24resultsGrouped)%20%7B%0A%20%20%20%20%24user%20%3D%20m365%20aad%20user%20get%20--id%20%24teamsUser.Name%20--output%20json%20%7C%20ConvertFrom-Json%0A%0A%20%20%20%20%23%20Count%20points%0A%20%20%20%20%23%20Each%20%20post%20is%20two%20points%2C%201%20extra%20point%20awarded%20for%20each%20Post%20with%20Subject%0A%20%20%20%20%23%20Each%20reply%201%20and%20each%20reaction%200.5%0A%20%20%20%20%24score%20%3D%20((%24teamsUser.Group%20%7C%20Where-Object%20%7B%20%24_.Type%20-eq%20%22Post%22%20%7D).Count%20*%202)%0A%20%20%20%20%24score%20%2B%3D%20((%24teamsUser.Group%20%7C%20Where-Object%20%7B%20%24_.HasSubject%20%7D).Count)%0A%20%20%20%20%24score%20%2B%3D%20(%24teamsUser.Group%20%7C%20Where-Object%20%7B%20%24_.Type%20-eq%20%22Reply%22%20%7D).Count%0A%20%20%20%20%24score%20%2B%3D%20((%24teamsUser.Group%20%7C%20Where-Object%20%7B%20%24_.Type%20-eq%20%22Reaction%22%20%7D).Count%20%2F%202)%0A%0A%20%20%20%20%24scoreResults%20%2B%3D%20%5Bpscustomobject%5D%5Bordered%5D%40%7B%0A%20%20%20%20%20%20%20%20DisplayName%20%20%20%20%20%20%20%3D%20%24user.displayName%0A%20%20%20%20%20%20%20%20UserPrincipalName%20%3D%20%24user.userPrincipalName%0A%20%20%20%20%20%20%20%20Score%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%24score%3B%0A%20%20%20%20%7D%0A%7D%0A%0A%23%20Sort%20our%20score%20report%20based%20on%20the%20score%0A%24scoreResults%20%3D%20%24scoreResults%20%7C%20Sort-Object%20%7B%20%24_.score%20%7D%20-Descending%0A%0A%23Construct%20adaptive%20card%0A%24title%20%3D%20%22%E2%80%8C%E2%80%8C%20Most%20active%20team%20members%22%0A%24scoreJson%20%3D%20'%7B%20%20%20%5C%22title%5C%22%3A%20%5C%22%E2%80%8C%E2%80%8C%20'%2B%24(%24scoreResults%5B0%5D.DisplayName)%2B'%5C%22%2C%20%20%20%5C%22value%5C%22%3A%20%5C%22'%20%2B%20%24(%24scoreResults%5B0%5D.score)%20%2B%20'%5C%22%20%20%20%7D'%0A%0Aif(%24scoreResults%5B1%5D)%7B%0A%20%20%20%20%24scoreJson%20%2B%3D%20'%2C%7B%20%20%20%5C%22title%5C%22%3A%20%5C%22%E2%80%8C%E2%80%8C%20'%2B%24(%24scoreResults%5B1%5D.DisplayName)%2B'%5C%22%2C%20%20%20%5C%22value%5C%22%3A%20%5C%22'%20%2B%20%24(%24scoreResults%5B1%5D.score)%20%2B%20'%5C%22%20%20%20%7D'%0A%7D%0Aif(%24scoreResults%5B2%5D)%7B%0A%20%20%20%20%24scoreJson%20%2B%3D%20'%2C%7B%20%20%20%5C%22title%5C%22%3A%20%5C%22%E2%80%8C%E2%80%8C%20'%2B%24(%24scoreResults%5B2%5D.DisplayName)%2B'%5C%22%2C%20%20%20%5C%22value%5C%22%3A%20%5C%22'%20%2B%20%24(%24scoreResults%5B2%5D.score)%20%2B%20'%5C%22%20%20%20%7D'%0A%7D%0A%0A%24card%20%3D%20'%7B%20%5C%22type%5C%22%3A%20%5C%22AdaptiveCard%5C%22%2C%20%5C%22%24schema%5C%22%3A%20%5C%22http%3A%2F%2Fadaptivecards.io%2Fschemas%2Fadaptive-card.json%5C%22%2C%20%5C%22version%5C%22%3A%20%5C%221.2%5C%22%2C%20%5C%22body%5C%22%3A%20%5B%20%20%7B%20%20%5C%22type%5C%22%3A%20%5C%22TextBlock%5C%22%2C%20%20%5C%22text%5C%22%3A%20%5C%22'%20%2B%20%24(%24title)%20%2B%20'%5C%22%2C%20%20%5C%22wrap%5C%22%3A%20true%2C%20%20%5C%22size%5C%22%3A%20%5C%22Medium%5C%22%2C%20%20%5C%22weight%5C%22%3A%20%5C%22Bolder%5C%22%2C%20%20%5C%22color%5C%22%3A%20%5C%22Attention%5C%22%20%20%7D%2C%20%20%7B%20%20%5C%22type%5C%22%3A%20%5C%22TextBlock%5C%22%2C%20%20%5C%22wrap%5C%22%3A%20true%2C%20%20%5C%22text%5C%22%3A%20%5C%22Week%20'%20%2B%20%24(get-date%20-UFormat%20%25V)%20%2B%20'%5C%22%2C%20%20%5C%22fontType%5C%22%3A%20%5C%22Default%5C%22%2C%20%20%5C%22size%5C%22%3A%20%5C%22Small%5C%22%2C%20%20%5C%22weight%5C%22%3A%20%5C%22Lighter%5C%22%2C%20%20%5C%22isSubtle%5C%22%3A%20true%20%20%7D%2C%20%20%7B%20%20%5C%22type%5C%22%3A%20%5C%22FactSet%5C%22%2C%20%20%5C%22facts%5C%22%3A%20%5B%20%20%20'%20%2B%20%24scoreJson%20%2B%20'%20%20%5D%20%20%7D%20%5D%20%7D'%0A%0Am365%20adaptivecard%20send%20--url%20%24webhookUrl%20--card%20%24card%3C%2FPUTYOURURLHERE%3E%3C%2FPUTYOURTEAMIDHERE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExecuting%20the%20script%20will%20tell%20you%20the%20progress%20as%20it%20can%20take%20a%20while%20to%20process%20all%20channels%20and%20messages%20depending%20the%20size%20of%20your%20team.%3C%2FP%3E%0A%3CP%3E%3CPICTURE%20class%3D%22inlineimage%22%3E%3CSOURCE%20srcset%3D%22https%3A%2F%2Fwww.cloudappie.nl%2Fwp-content%2Fuploads%2F2021%2Fteam-champion-script.webp%22%20type%3D%22image%2Fwebp%22%3E%3C%2FSOURCE%3E%3C%2FPICTURE%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22team-champion-script.png%22%20style%3D%22width%3A%201232px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F301732i3DD85E04597B27FC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22team-champion-script.png%22%20alt%3D%22team-champion-script.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOnce%20the%20script%20is%20finished%20you%20can%20expect%20an%20adaptive%20card%20showing%20the%20score%20for%20that%20team.%20If%20no%20top%203%20can%20be%20constructed%20it%20will%20only%20show%20the%20top%201%20or%202%2C%20and%20their%20score.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CPICTURE%20class%3D%22inlineimage%22%3E%3CSOURCE%20srcset%3D%22https%3A%2F%2Fwww.cloudappie.nl%2Fwp-content%2Fuploads%2F2021%2Fteam-champion-result.webp%22%20type%3D%22image%2Fwebp%22%3E%3C%2FSOURCE%3E%3C%2FPICTURE%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22team-champion-result.png%22%20style%3D%22width%3A%20991px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F301733iD83A73A51CC6AE36%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22team-champion-result.png%22%20alt%3D%22team-champion-result.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CSECTION%20class%3D%22post-full-content%22%3E%0A%3CDIV%20class%3D%22kg-card-markdown%22%3E%0A%3CP%3EHopefully%20this%20sample%20provides%20some%20insights%20in%20how%20you%20can%20track%20activity%20and%20recognize%20the%20contributions%20team%20members%20make%20per%20team.%20I%20love%20playing%20around%20with%20samples%20like%20this%20as%20its%20a%20great%20way%20to%20learn%20the%20commands%20and%20see%20what%20value%20you%20can%20add%20based%20off%20data%20and%20information%20already%20present%20in%20your%20Microsoft%20365%20tenant.%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FSECTION%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2626789%22%20slang%3D%22en-US%22%3E%3CP%3EInspired%20by%20the%20previous%20blog%20to%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-365-pnp-blog%2Fuse-cli-for-microsoft-365-to-recognize-contributions%2Fba-p%2F2595191%22%20target%3D%22_blank%22%3Euse%20CLI%20for%20Microsoft%20365%20to%20recognize%20contributions%3C%2FA%3E%20I%20got%20challenged%20by%20the%20community%20on%20to%20reconsider%20the%20approach.%20Instead%20of%20using%20metrics%20on%20all%20Microsoft%20Teams%20Thomas%20G%C3%B6lles%20challenged%20me%20to%20use%20metrics%20of%20a%20specific%20team.%20By%20focusing%20on%20other%20metrics%20then%20messages%20send%20you%20can%20get%20a%20better%20understanding%20of%20activity.%20After%20some%20discussion%20we%20decided%20that%20a%20scoring%20mechanism%20should%20be%20in%20place%20to%20score%20each%20member%20and%20award%20activity%20points.%20And%20thus%2C%20a%20new%20post%20with%20a%20slightly%20different%20approach%20to%20recognize%20activity%20by%20Team%20members%20for%20a%20specific%20team.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22team-champion-header.png%22%20style%3D%22width%3A%201006px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F301731i41C74DDD4C89ABDC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22team-champion-header.png%22%20alt%3D%22team-champion-header.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎Aug 09 2021 02:55 AM
Updated by: