QuickTip: Getting the Microsoft Teams Team ID and Channel ID for Power Automate Flows

QuickTip: Getting the Microsoft Teams Team ID and Channel ID for Power Automate Flows

When working with Power Automate recently I was struggling being able to get the Teams and Channel IDs but with a bit of Googling I managed to work out how to obtain this information. So all that is required is the following expressions created under Data Operation

For Microsoft Teams Team IDs

first(split(last(split(triggerBody()['webUrl'],'groupId=')),'&tenantId'))

For Microsoft Teams Channel IDs

replace(replace(last(split(first(split(triggerBody()['webUrl'],concat('/',triggerBody()?['etag']))),'message/')),'%3A',':'),'%40','@')

With these expressions within your Power Automate flows you will be able to gather the required information.

Regards
The Author – Blogabout.Cloud

Power Automate and Microsoft Teams Tips: Automated approach to creating new Microsoft Teams Channels

Power Automate and Microsoft Teams Tips: Automated approach to creating new Microsoft Teams Channels

Over the coming weeks I am going to be doing Power Automate post to demostrate the ability to automate workloads within Microsoft 365. Today, I am going look at configuring an Approval process for the creation of a Microsoft Teams Channel

Configuring a SharePoint List

I am no expert when it comes to SharePoint but any expert in “Share Pint” as how does love a good drink now and then. So back on topic within your SharePoint Online Site you need to create a new list as shown in the image below.

This image has an empty alt attribute; its file name is image-34-1024x404.png

Give your SharePoint List a name and description for future reference.

As you can see from the below, I have create a number of columns to capture the information I would like to include into the approval process.

Column NameColumn Type
Title Title used for the Channel Name.
Team NameName of the Microsoft Team
DescriptionDescription of the new Channel
JustificationJustification for the request

Configuring Power Automate

Create a new Flow from the SharePoint List > Automate > Power Automate > See your Flows

Click New > Automated from blank. Provide a Flow name, i.e. “Request – New Microsoft Teams Channel Provisioning”,

Select your Site Address and List Name as shown below.

Modify the Start an approval in line with your requirements, for this post I have included the layout I have created for my own tenant.

We now need a Data Operation in order to gather the Teams ID which is required to identify the Teams where the channel will be created.

first(split(last(split(triggerBody()['webUrl'],'groupId=')),'&tenantId'))

Add connector List teams and no additional

Create Filter array which looks at the Teams List based on the Team Name against the entry in the SharePoint List.

Next step is to create a channel with uses the apply to each array.

We have now completed the flow, so let’s go and create the request. As shown below.

This will now generate a request to create the team channel automatically in the background and as you can see all the new Project Channels have been created.

Regards,
The Author – Blogabout.Cloud

PowerShell Tip: Do all your Microsoft Teams have owners?

PowerShell Tip: Do all your Microsoft Teams have owners?

In many organisations where governance around the creation of Microsoft Teams is currently not in place. You may come across Teams where the owner may have left the organisation but the Team is still active. So using PowerShell we can find which Teams have or do not have owners.

Prerequistes

Microsoft Teams Module needs to be installed

Install-Module MicrosoftTeams

PowerShell Script

The following script will obtain all the required information and export to CSV.

$availableTeams = Get-Team
  $teams = @()
  foreach($team in $availableTeams)
  {
 
    Write-host "Discovered the following team:"  -NoNewline
    Write-host $team.DisplayName -ForegroundColor Yellow
    $users = Get-TeamUser -GroupId $team.GroupId
    $channel = Get-TeamChannel -GroupId $Team.GroupId
    $owners = @($users | Where-Object {$_.Role -eq 'owner'})
    $members = @($users | Where-Object {$_.Role -eq 'member'}).Length
    $guests = @($users | Where-Object {$_.Role -eq 'guest'}).Length

    Write-Host "Number of Owners =",($owners.count),"| Number of Members =",($members.count),"| Number of Guests =",($guests.count)

    $teamObject = New-Object -TypeName PSObject
    $teamObject | Add-Member -MemberType $NoteProperty -Name DisplayName -Value $team.DisplayName
    $teamObject | Add-Member -MemberType $NoteProperty -Name GroupID -Value $team.GroupId
    $teamObject | Add-Member -MemberType $NoteProperty -Name Alias -Value $team.MailNickName
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamVisibility" -Value $Team.Visibility
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamArchived" -Value $Team.Archived
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamOwners" -Value ($owners).Count
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamMembers" -Value ($members).Count
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamGuests" -Value ($guests).Count
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamOverallUserCount" -Value $users.Count
    $teamObject | Add-Member -Membertype $noteproperty -Name "TeamChannelCount" -Value $channel.Count


    if($owners.Count -eq 1)
    {
      $teamObject | Add-Member -MemberType $NoteProperty -Name 'Owner' -Value $owners[0].User
    }

    write-host ' Analysis Completed' -BackgroundColor DarkGreen
    $teams += $teamObject
  }

  $teams | Export-Csv -Path $env:USERPROFILE\desktop\Get-MicrosoftTeamOwnerInfo.csv
  write-host "Output exported to: $env:USERPROFILE\desktop\Get-MicrosoftTeamOwnerInfo.csv" -BackgroundColor DarkGreen
}

Regards,
The Author – Blogabout.Cloud

Power Automate and Microsoft Teams Tips: Posting messages on Teams Channel when a RSS feed published

Power Automate and Microsoft Teams Tips: Posting messages on Teams Channel when a RSS feed published

Over the coming weeks I am going to be doing Power Automate post to demostrate the ability to automate workloads within Microsoft 365. Today, I am going look demostrate how I take RSS feeds from Microsoft Blogs and distrube to Microsoft Teams / To-Do. If you have been following my blog for a while you will know I am a big avocate for bringing code important data from Microsoft into Microsoft Teams. As an Architect working within the Microsoft 365 stack, there is always developments, releases and updates coming from Microsoft.

So how do we handle all this information from multiple sources into Microsoft Teams.

So as you can see from below, I have a Microsoft Team called “Microsoft Blogs” in this Teams. I have seperate channels for the areas I am most interested in;

  • Teams
  • Endpoint Manager
  • etc..

I gather this data from https://techcommunity.microsoft.com/t5/custom/page/page-id/Blogs

For the purpose of this post I am going to be looking at the Microsoft Security and Compliance Blog. This is a blog that I follow today and generates the most noise. So I am going create a new channel called Microsoft Security and Compliance Blog within Microsoft Blogs Teams.

So first of, make sure you create the Channel where you wil be publishing this data. Next we need the RSS URL, so if you click on the RSS button it will open a new tab with the required URL in the address bar

https://techcommunity.microsoft.com/plugins/custom/microsoft/o365/custom-blog-rss?tid=-1974032735906843784&board=MicrosoftSecurityandCompliance&label=&messages=&size=10

Configure Power Automate

Create a new Automated Flow

Provide a new for the Flow and select When a feed item is published

Enter the URL for the RSS Feed

Specify the Team and Channel you would like to publish the message. In my message I am providing a link to the Article, the date is was published, the Title and Summary of the post. The reason for this is so that if I am on the move, I can synchronize the content of the blog post to Microsoft Teams or even Microsoft To-Do so I can continue to read on the move.

When there is a new blog post published you will receive a message into your defined channel, just like the below

Why not To-Do?

So as I mentioned, I also push the blog posts to Microsoft To-Do. The reason for this is so I can close the To-Do item once I have read the article so I never miss any important updates.

You dont even how to stop there if you dont want to. You can leverage what ever connector you want in Power Automate to publish the data.

Regards
The Author – Blogabout.Cloud

Power Automate and Microsoft Teams Tips: Approval request process for a new Microsoft Teams Team

Power Automate and Microsoft Teams Tips: Approval request process for a new Microsoft Teams Team

Over the coming weeks I am going to be doing Power Automate post to demostrate the ability to automate workloads within Microsoft 365. Today, I am going look at configuring an Approval process for the creation of a Microsoft Teams Team

Configuring a SharePoint List

I am no expert when it comes to SharePoint but any expert in “Share Pint” as how does love a good drink now and then. So back on topic within your SharePoint Online Site you need to create a new list as shown in the image below.


Give your SharePoint List a name and description for future reference.

As you can see from the below, I have create a number of columns to capture the information I would like to include into the approval process.

Column NameColumn Type
TitleTitle used for the Team Name.
DescriptionSingle line of text used to store the project description.
VisibilityChoice with the following options: “Private” and “Public”. Indicates if a team should visible to non-team members.
OwnersPerson or Group with Allow multiple selections enabled.
MembersPerson or Group with Allow multiple selections enabled.
JustifcationMultiple line of text used

Configuring Power Automate

Create a new Flow from the SharePoint List > Automate > Power Automate > See your Flows

Click New > Automated from blank. Provide a Flow name, i.e. “Request – New Microsoft Teams Team Provisioning”,

Select the SharePoint “When an item is created” trigger and click “Create”.

Select your Site Address and List Name from the drop down lists

Create a Start and wait for an approval condition. I have populated the below with information that I required within my own tenant.

Select Apply to each condition and select responses

Select Responses Approver response is equal to Approve

This section is now a bit more complex as I have decided to include an email notification if the request was a approved or rejected. If you follow the screenshot below you will see that I am using the SharePoint List items to provide Team Name, Description, Visiability fields and leveraging the list to include information into the email notification. You dont need to add email notifications into your flow but this is how you would do it.

Now we need to apply each Owner and Member to the new Microsoft Teams and this is completed as followed.

We have now completed the flow, so lets go and create the request. As shown below.

This will now generate a request to the approvers email address and when they click approve the team will be created as shown below with all the Owners and Members you defined.

Regards,
The Author – Blogabout.Cloud

Quick Tips: How do I restore a deleted Microsoft Teams Team using PowerShell.

Quick Tips: How do I restore a deleted Microsoft Teams Team using PowerShell.

Sometimes accidents happen and things get deleted by mistake but what do you do if you delete a Microsoft Team by mistake?

When the team is deleted, it is held in the “recycle bin” for 30 days until it is permanently deleted. The following is the process of restoring a deleted team in Microsoft Teams.

  • Once Team is deleted, option to recover it exists for up to 30 days
  • All of it including (Channels, files, tabs, etc.) will reappear as it was before
  • Restore can take up to 4 hours
  • To restore, from exchange admin center, select recipients, then groups
  • Locate the group (only if soft deleted)
  • Select the group and choose restore

This is where my favourite Microsoft tool comes into action, PowerShell

Prerequisites

AzureAD Module is installed
Global Admin to your Azure AD Tenant

Process

Launch PowerShell as an administrator


1
Connect-AzureAD

When a team is created in Microsoft Teams, it creates an Office 365 group. In order to restore the group you will need to obtain the Id using the following cmdlet


1
Get-AzureADMSDeletedGroup

1
Restore-ADMSDeletedDirectoryObject –ID <objectID>

As mentioned above the restore could take up to 4 hours to complete.

Regards
The Author – Blogabout.Cloud
           

Bringing Power Automate and Office 365 Service Communications API v2 together to deliver Current Status into Microsoft Teams.

Bringing Power Automate and Office 365 Service Communications API v2 together to deliver Current Status into Microsoft Teams.

I have been recently looking how to provide the Current Status of the Microsoft 365 stack into an automated process so I could quickly identify any outages. The Office 365 Service Communications API v2 does exactly that and also allows additional options like Power Automate and PowerShell to pull the data. So in this particular article I am going to look at pushing the Current Status into Microsoft Teams so not just myself but anyone who is apart of the Teams is able to see the status.

Prerequisites

  • You have configured Azure AD App for Office 365 Service Communications API v2
  • Licensed for Power Automate either;
    • Per user plan
    • Per user plan with attended RPA
    • Per Flow plan

Configuring Power Automate to deliver posts into Microsoft Teams Channel.

You will now need to repeat the above process for client_secret and tenantid

After that, you need to create an HTTP action to query the Office 365 API. Populate the same as below, making sure all 3 variables are used.

Please be aware the HTTP Connector has an associated cost due to being a Premium Connector. This cost can be found at the following link

If you were to run the flow at this point it would return a big output of JSON. It’s best to use the Parse JSON action to make it easier to read. Set the Content as the Body of the previous HTTP action and the Schema below:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
    "type": "object",
    "properties": {
        "@@odata.context": {
            "type": "string"
        },
        "value": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "FeatureStatus": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "FeatureDisplayName": {
                                    "type": "string"
                                },
                                "FeatureName": {
                                    "type": "string"
                                },
                                "FeatureServiceStatus": {
                                    "type": "string"
                                },
                                "FeatureServiceStatusDisplayName": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "FeatureDisplayName",
                                "FeatureName",
                                "FeatureServiceStatus",
                                "FeatureServiceStatusDisplayName"
                            ]
                        }
                    },
                    "Id": {
                        "type": "string"
                    },
                    "IncidentIds": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "Status": {
                        "type": "string"
                    },
                    "StatusDisplayName": {
                        "type": "string"
                    },
                    "StatusTime": {
                        "type": "string"
                    },
                    "Workload": {
                        "type": "string"
                    },
                    "WorkloadDisplayName": {
                        "type": "string"
                    }
                },
                "required": [
                    "FeatureStatus",
                    "Id",
                    "IncidentIds",
                    "Status",
                    "StatusDisplayName",
                    "StatusTime",
                    "Workload",
                    "WorkloadDisplayName"
                ]
            }
        }
    }
}

Once the data has been parsed, you can loop through each service and check for service status. The next action is to add an Apply to each action for the value variable.

Within the loop, add a Group Condition that Status is equal to ServiceOperational and ServiceRestored.

Under the If No condition, you can add an action because the service is not operational. To demonstrate, I’ve configured steps for posting a message to Microsoft Teams as shown below

This will then be triggered when there is any status that doesn’t match the define ServiceOperational or ServiceRestored within Office 365. As you can see below I have been notified in Microsoft Teams for an issue with Microsoft 365 stack.

Regards
The Author – Blogabout.Cloud

Bringing your Microsoft 365 Reporting into Microsoft Teams

Bringing your Microsoft 365 Reporting into Microsoft Teams

More and more organisations are looking at way to leverage automation within their environments and as an Architect I am seeing a lot conversations about reporting.

So this is where Microsoft Teams and Power BI go hand in hand. It is really simple to bring in the native reporting into a Microsoft Teams Channel using a default Power BI template as I am now going to demostrate.

Prerequistes

  • Power BI is installed on your client machine
  • Microsoft Teams is installed on your client machine

Configuring Power BI

First of all you need to download the Microsoft 365 reporting template from the Microsoft Download center and store in a easy location as we will need this template file during this post. Next we need launch your Power BI client and click Open other reports

Select the template file you have just downloaded and click open

You will now need to provide your tenant ID, this can be easily found by going to portal.azure.com, select Azure Active Directory and within the overview pane you will see your tenant ID.

Click Load and the template will now start gathering the required data, You may be prompted to provide Administrator credentials in order to gather the data from your Microsoft 365 Tenant. Once all data has been gathered you will be provided with a dashboard like below showing all the statatics that have been gathered.

We now need to publish this Power BI Report in order to leverage in Microsoft Teams.

Select the destination of where you would like the report stored and give it a name and phyiscal storage location on your device or network.

Once the report has been successful published to Power BI we are now ready to put this report into your Microsoft Teams Channel(s)

Publishing Report to Microsoft Teams

So within your Microsoft Teams client select the require and channel you would like to publish Power BI to, click the plus symbol as shown below.

Select Power BI

Select your report and save

And as if like magic you have published Microsoft 365 reporting into Microsoft Teams.

As I have only just run through the basics you can exactly modify the template look and feel to customize it to your needs or even your customers needs. So there you have it, Power BI, Microsoft Teams automation using Microsoft 365 reporting.

Regards
The Author – Blogabout.Cloud

Bye Bye Skype for Business Connector.

Bye Bye Skype for Business Connector.

As Microsoft starts to contine to wind down Skype for Business Online, there is no longer a need to install the seperate module using the .exe file for the Skype Connector. The module has been in beta release of the Microsoft Teams module which has now been published to general availability (GA).

Update your MicrosoftTeam module to version 1.1.6 and you will find the cmdlet “New-CSOnlineSession” available to use. To make life easier, check out my Get-InstalledModulesUpdate.ps1 from my GitHub. This PS1 file will look at all installed modules on your client machine and update according.

Here is the current versioning information for MicrosoftTeams module.

DateVersionUpdates
September 20201.1.6Skype for Business Online Connector integration
September 20201.1.5-previewSkype for Business Online Connector integration
July 20201.1.4Added group policy assignment cmdlets
June 20201.1.3-previewSkype for Business Online Connector integrationGet-Team optimizationsEnhanced reliability
June 20201.0.7Added Cmdlet preloading.Net Framework optimizations
April 20201.0.6Authenticode and assembly signingAdded Get-CsPolicyPackageAdded Get-CsUserPolicyPackageAdded Get-CsUserPolicyPackageRecommendationAdded Grant-CsUserPolicyPackageAdded New-CsBatchPolicyPackageAssignmentOperationAdded Set-TeamArchivedStateAdded Set-TeamPictureRemoved Get-TeamHelp
March 20201.0.5Added New-CsBatchPolicyAssignmentOperation
Feb 20201.0.4Get-Team optimizations

Regards
The Author – Blogabout.Cloud

Whats new in the Microsoft 365 Roadmap? (11/09/2020)

Whats new in the Microsoft 365 Roadmap? (11/09/2020)

Additions : 4
Updates : 5

More Details At: www.roadmapwatch.com


New FeaturesCurrent Status
Microsoft compliance center: Records Management in Microsoft 365 available in Government cloudIn Development
Microsoft Lists: updated Yes/No column experiences – powered by SharePoint?In Development
Microsoft Teams: Manage your meeting options in-meetingIn Development
Microsoft Teams: End-of-meeting notificationsIn Development
Updated FeaturesCurrent StatusUpdate Type
Microsoft Teams: Channel info paneLaunchedStatus
Microsoft Teams – Dynamic viewIn DevelopmentDescription
Microsoft Teams: NDI for TeamsRolling OutStatus
Microsoft Forms: New Office 365 HeaderLaunchedStatus
Office 365 Advanced Threat Protection: Enabling export of security reportsRolling OutStatus

Regards
The Author – Blogabout.Cloud