Create a Single Page Application using Microsoft Graph and JavaScript – Let’s Learn a M365 – vlog 6

In this video I explain how to create a Single Page Application using Microsoft Graph and JavaScript.

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g if this helped you , to appreciate my work and keep me motivated.

Source code used in the Tutorial can be downloaded from here: https://github.com/sinhakislay/SPA-MS…

This solution is based on a solution created by Cameron Dwyer https://github.com/CameronDwyer/M365D…

I have extended this to learn more and added another page to get Outlook messages.

In this video I have explained all the files and code in detail.

References: https://camerondwyer.com/2020/10/27/g…

https://developer.microsoft.com/en-us…

Node.js: https://nodejs.org/en/

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog 

https://www.linkedin.com/in/kislaysinha

https://www.youtube.com/channel/UC6vL…

Create a SPFx App using Microsoft Graph Tookit 2.0 – Let’s Learn a Microsoft 365 Topic

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g if this helped you , to appreciate my work and keep me motivated.

In this video I explain how to create an SPFx application in SharePoint using Graph Took Kit 2.0

Source code is available at this location with detail steps: https://github.com/sinhakislay/SPfx-g…

Video consists of following:

1. Talk about prerequisites

2. Code overview

3. How to set up and use Microsoft Graph Toolkit 2.0

4. Demo of the Web Part and Microsoft

Summary

This uses SharePoint Development Framework and Microsoft Graph Toolkit 2.0 Language used is TypeScript This showcases how to develop an SPFx App and load Microsoft Graph Toolkit components in SPFx web part Details of the source code and how to run etc is also described in video here 

Minimal Path to Awesome

#SPFX #MicrosoftGraph #Graphtoolkit #SharePoint #Yeoman #nodejs #npm

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog 

https://www.linkedin.com/in/kislaysinha

https://www.youtube.com/channel/UC6vL…

Last week in Microsoft 365 – 12 Nov – 18 Nov 2020 – VLog 6

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g if this helped you , to appreciate my work and keep me motivated.

In the 6th episode of Last week in Microsoft 365 I discuss five topics

1. Dynamically Populate Owner Value (User or Team) in Power Automate – Lin Zaw Win: In this Lin explains how to update owner value on basis of another row owner value, great description how to do it. Links: https://twitter.com/LinnZawWin https://linnzawwin.blogspot.com/2020/…

2. Calling the Microsoft Graph with PnP PowerShell – Paul Bullock: A very simple and neat explanation of how to call Microsoft Graph from PnP PowerShell and great scenario where you want to find out if Group is Team Connected or Yammer connected Links: https://twitter.com/pkbullock/status/… https://capacreative.co.uk/2020/11/11…

3. Outlook REST API v2-0 deprecation notice: Time has come to replace Outlook REST API with Graph API, it will be deprecated on 30th Nov 2022 Link: https://developer.microsoft.com/en-us…

4. Learn to build Apps for Teams – Learn TV: A great opportunity to learn from best people to create Apps for Teams, please register fast Links: https://twitter.com/LearnTV/status/13… https://learntogether.splashthat.com/

5. Microsoft Forms Brings Polls to Teams Meetings – Melinda Hu: Foems is now available as App or Tab and also in Meetings which is a great addition https://techcommunity.microsoft.com/t…

YouTube Playlist

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog 

https://www.linkedin.com/in/kislaysinha

https://www.youtube.com/channel/UC6vL…

How to use Microsoft Graph Toolkit with React – Let’s Learn a Microsoft 365 Topic – Vlog 5

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g

In this video I create a simple App using React framework and Microsoft Graph Tookit, video covers following

  • What is Microsoft Graph Tookit?
  • A collection of resusable components which can be used out of box which fetches data and authenticates using Microsoft Graph
  • It can cut down development time as out of box web components can be used easily with least effort
  • It works in all browsers hence once you build it, it can run anywhere
  • Prerequisites :
  • Microsoft 365 Developer account
  • Visual Studio code or any other IDE
  • Node.js installed
  • Git installation
  • Azure Directory App to be used with Microsoft Graph Toolkit
  • Create a simple React App to load Calendar information and use Sign in component details are explained in the video

Here are some reference links

https://docs.microsoft.com/en-us/offi…

https://code.visualstudio.com/ https://nodejs.org/en/ https://git-scm.com/downloads

Source code reference: https://docs.microsoft.com/en-gb/grap…

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog https://twitter.com/SinhaKislay

https://www.linkedin.com/in/kislaysinha

https://synkventures.com

/https://www.youtube.com/channel/UC6vL…

Last week in Microsoft 365 – 05 Nov – 11 Nov 2020 – VLog 5

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g

In this VLog I have covered following topics

  • Use Microsoft Graph Toolkit with React
  • Patch SharePoint Choices columns in Power Apps  – Matthew Devaney
  • Me Experience in Microsoft Teams using Graph ToolKit and SPFx – Rabia Williams
  • Announcing general availability of Microsoft Teams Resource-specific consent and read channel messages – Microsoft 365 Dev team
  • How to record 1:1 Teams and PSTN calls with OBS Studio for free – Luca Vitali

Transcript of the video:

Hello and welcome all to series “Last week in Microsoft 365”, this is the fifth video in this series in and we have 5 topics to be highlighted this week which I liked.

1. Use Microsoft Graph Toolkit with React : The shared documentation explains how to create Apps using React and Microsoft Graph Tool kit. I have also done a YouTube video on this which you can refer here: https://www.youtube.com/watch?v=2qVL8mWux-4&t

Links: https://docs.microsoft.com/en-gb/grap…

2. Patch SharePoint Choices columns in Power Apps – Matthew Devaney : In this Matthew explains how to use Patch functionality, recently Reza Dorrani also did a video on this topic in which he also referred to Matthew’s blog, refer the video here https://www.youtube.com/watch?v=VzrarcM9W5k&feature=youtu.be

Links: https://twitter.com/mattbdevaney/stat… https://matthewdevaney.com/power-apps…

3. Me Experience in Microsoft Teams using Graph ToolKit and SPFx – Rabia Williams : In this Rabia explains how you can create Microsoft Teams Me experience which is quite unique explains all kind of possibilities we have using Microsofy Graph Toolkit

Links: https://rabiawilliams.com/teams/me-ex…

4. Announcing general availability of Microsoft Teams Resource-specific consent and read channel messages – Microsoft 365 Dev team

Links: https://developer.microsoft.com/en-us…

5. How to record 1:1 Teams and PSTN calls with OBS Studio for free – Luca Vitali

This is a great article bu Luca to explain how to use OBS Studio to record 1:1 Teams and PSTN calls.

Links: https://lucavitali.wordpress.com/2020…

Episode 1 Link: https://www.youtube.com/watch?v=4Mteq…

Episode 2 Link: https://www.youtube.com/watch?v=811h7jrqYlg&t=127s&ab_channel=SYNKVentures-Let%27stalkMicrosoft365

Episode 3 Link: https://www.youtube.com/watch?v=SQXjobuVCqY&t

Episode 4 Link: https://www.youtube.com/watch?v=4jnEvy9a-hk

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog 

https://www.linkedin.com/in/kislaysinha

https://synkventures.com

https://www.youtube.com/channel/UC6vL…

Last week in Microsoft 365 – 29 Oct – 04 Nov 2020 – VLog 4

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g?sub_confirmation=1

In this VLog I have covered following topics

  • Matt-Collins 366 days video streak
  • SharePoint Roadmap Pitstop Oct 2020 – Mark Kashman
  • Extend SPFx solution testability – Marcin Wojciechowski
  • GA Microsoft To Do API in Microsoft Graph – Microsoft 365 Dev team
  • What’s new in Microsoft Teams?  – Oct 2020

Hello and welcome all to series “Last week in Microsoft 365”, this is the fourth video in this series in and we have 5 topics to be highlighted this week which I liked.

1. First one is something which really inspired me when I saw this post from Matt-Collins about his 366 days video streak on YouTube and me being a new YouTuber it was great to see someone else success in this area so a big shout put to Matt-Collins of putting this through so do visit his YouTube page and check awesome videos. You can also follow him on Twitter, his videos is mostly about Dynamics 365 and Power Platform

Links: https://www.linkedin.com/posts/mattco…

https://www.youtube.com/c/MattCollins…

https://twitter.com/D365Geek

2. Second topic is SharePoint Roadmap pitstop Oct 2020 from Mark Kashman, since the last week also was month end which means we have bunch of Roadmap Pitstops. In this you also have Podcast where Mark talks to Harsh about new file sharing experience in teams channels, chats and also some other bunch of updates

Link: https://techcommunity.microsoft.com/t…

3. So the third one is which I saw on Twitter from Marcin where he has created a test sample projects for SP Developers which means how to create stubs to test out your app or web part like an example he has given to simulate Mock Order and Mock User provider, so have a look, I think this has good use case for testing.

Links: https://twitter.com/mgwojciech/status…

https://github.com/mgwojciech/unit-te…

https://mgwdevcom.wordpress.com/2020/…

4. The fourth one is General Availability of To Do API In Microsoft Graph API which is a great news as I believe lot of people might have been waiting for this, it’s a bunch of CRUD operations on Tasks list and linked resources

Links: https://developer.microsoft.com/en-us…

5. The last one today is an article “What’s new in Microsoft Teams?”, this is a collection of bunch of things announced in Microsoft Teams so let’s have a look into some of these.

Links: https://techcommunity.microsoft.com/t…

Episode 1 Link: https://www.youtube.com/watch?v=4Mteq…

Episode 2 Link: https://www.youtube.com/watch?v=811h7jrqYlg&t=127s&ab_channel=SYNKVentures-Let%27stalkMicrosoft365

Episode 3 Link: https://www.youtube.com/watch?v=SQXjobuVCqY&t

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog 

https://twitter.com/SinhaKislay

https://www.linkedin.com/in/kislaysinha

/https://synkventures.com

/https://www.youtube.com/channel/UC6vL…

Last week in Microsoft 365 – 22 Oct – 28 Oct 2022 – VLog 3

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g?sub_confirmation=1

In this VLog I have covered following topics

  • Teams reached 115 million daily activer users (DAU) – Jeff Teper
  • Microsoft 365 Boot camp session about Microsoft Graph– Cameron Dwyer
  • General Availability of Microsoft Forms for personal use
  • Build advanced queries in Microsoft Graph with $count, $filter, $search, and $orderby – Beth Pan
  • Importing third-party platform messages to Microsoft Teams is now available in beta – Fabian Williams

Hello and welcome all to series “Last week in Microsoft 365”, this is the third video in this series in and we have 5 topics to be highlighted this week which I liked.

1. First one is a great news I saw on Twitter and Linked In from Jeff Teper that Microsoft Teams reached 115 million daily active users, it was at 75 million in April 2020. It is also clocking 30 billion collaboration minutes in a day. Surely COVID has helped this massive surge but Teams is one of the best things happened to us end users and also to Microsoft, it has taken the collaboration to next level. So Congrats to Microsoft for this feat and also to Jeff Teper and his team. I feel proud that I am one of the user and also have somehow helped in this growth journey.

Links: https://twitter.com/jeffteper/status/… https://www.microsoft.com/en-us/micro…

2. Second topic is from Cameron Dwyer about a Microsoft 365 Boot camp session about Microsoft Graph, this session is highly recommended if you want to understand power of Microsoft Graph, it covers the steps to create an App, how authentication works and how to set it up in great detail, as I said don’t miss this if you want to learn about Microsoft Graph.

Links: https://twitter.com/CameronDwyer/stat… https://camerondwyer.com/2020/10/27/g… https://www.youtube.com/watch?v=v8siJ…

3. So the third one is General Availability of Microsoft Forms for personal use, I think this is a great addition as I have always found Microsoft Forms easy to use and create quiz etc. This can be replace some of other tools which are available in market. So now you can invite friends family to use this as well

Link: https://www.microsoft.com/en-us/micro…

4. The fourth one is I saw an announcement from Beth Pan regarding “Build advanced queries in Microsoft Graph with $count, $filter, $search, and $orderby” , the blog post seems to be from September but I saw that just few days back, but it explains how easy is to query using count, filter etc. Links: https://twitter.com/beth_panx/status/… https://developer.microsoft.com/en-us…

5. The last one today is an another announcement I saw from Fabian Williams about “Importing third-party platform messages to Microsoft Teams is now available in beta” , this means that you can now import third party messages into Teams if you are migrating to Teams. Links: https://twitter.com/fabianwilliams/st… https://developer.microsoft.com/en-us… https://docs.microsoft.com/en-us/micr…

Episode 1 Link: https://www.youtube.com/watch?v=4Mteq…

Episode 2 Link: https://www.youtube.com/watch?v=811h7jrqYlg&t=127s&ab_channel=SYNKVentures-Let%27stalkMicrosoft365

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog https://twitter.com/SinhaKislay

https://www.linkedin.com/in/kislaysinha

/https://synkventures.com

/https://www.youtube.com/channel/UC6vL…

Last week in Microsoft 365 – 15 Oct – 21 Oct 2020 – VLog 2

In this VLog I have covered following topics

  • 1.Building a Me-experience in Microsoft Teams by Waldek
  • 2.How to use Microsoft Teams Templates as end user and Admin – Paolo Pialorsi
  • 3.General Availability of Microsoft Graph Teams Membership API – Brian T Jackett
  • 4.Improved News / Page Publishing Exprience –Marc D Anderson
  • 5.Power Automate Desktop October 2020 update

Transcript of the video:

Hello and welcome all to series “Last week in Microsoft 365”, this is the second video in this series and we have 5 topics to be highlighted this week which I liked.

1. First one is the Building a Me-Experience in Microsoft Teams which I got to know from Waldek’s blog, as it says there is no “I” but Me in Microsoft Teams. Basically it explains how you can utilize SharePoint Framework to offer a Me-Experience where users can start their day seeing their personal information. The article explains each options in very detail. So how to do it

a. Embed a modern SharePoint page: this approach is great as it does not any coding and can be done by creating modern page with different web parts and embedding it as Teams tab

b. Build a multi tab personal teams app: this requires some coding effort but not so difficult as you can steps are quite self explanatory

c. Combine multiple web parts in single tab: This is same as before but you need to use React to combine multiple React components Link: https://blog.mastykarz.nl/build-me-ex…

https://docs.microsoft.com/en-us/shar…

2. Second topic is from Paolo Pialorsi where he explains how to use recently introduced Microsoft Teams templates as an end user and Admin. He walks you through all details of the how to create a template etc from Admin portal. He also explains how you can utilize Microsoft Graph explorer Link: https://www.youtube.com/watch?v=-YQxF…

https://twitter.com/PaoloPia/status/1…

3. So the third one is General Availability of Microsoft Graph Teams Membership API which I saw from a Tweet of Brian T Jackett, basically it is an announcement made regarding Microsoft Graph Team Membership APIs that is a newly added API which adds , removes users faster. As we can see the article was originally written by Abhishek Anand. Link: https://twitter.com/BrianTJackett/sta…

https://developer.microsoft.com/en-us…

4. The fourth one is also regarding a roadmap announcement which I came to know more Marc D Andersson where we will have an improved expriences in which users needs to input mandatory fields before publishing a news or page. This is planned to be released in Oct 2020 Link: https://twitter.com/sympmarc/status/1…

https://www.microsoft.com/en-us/micro…

5. The last one today is related to Power Automate Desktop October 2020 update. Recently Microsoft has released Power Automate Desktop and lot of improvements will be released soon so here is a summary of all those. If you want to try Power Automate Desktop please refer to link pasted in description Link: https://flow.microsoft.com/en-us/blog…

https://docs.microsoft.com/en-us/powe…

Episode 1 Link: https://www.youtube.com/watch?v=4Mteq…

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog https://twitter.com/SinhaKislay

https://www.linkedin.com/in/kislaysinha

/https://synkventures.com

/https://www.youtube.com/channel/UC6vL…

Microsoft 365 Lists – first look and overview

If you like my blog post please subscribe to my YouTube Channel “SYNK Ventures – Let’s talk about Microsoft 365” as well https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g?sub_confirmation=1

What is Microsoft Lists? Refer to my old blog https://synkventures.com/2020/05/24/microsoft-365-lists-a-powerful-app-sharepoint-lists-not-needed-any-more/

Finally on 28th July 2020 Microsoft Lists have arrived in our tenants (10% targeted release), here is the icon and just click on it to access the Lists page.

Microsoft Lists icon
Microsoft Lists home page

What are the ways to create lists?

  1. You can create a blank list as we use to do like custom list in SharePoint.
  2. You can start with an existing excel which means that if you have excel you can use that create a list with same set of columns etc
  3. You can pick any one of the templates to create a list.
  4. You can also use an existing list of create a list which means you don’t have to start from scratch and any existing list can be used as template.

We will have a look at all these one by one but first let’s discuss templates.

What are the templates available and their usages?

  1. Issue Tracker: This to track issues, similar template is available in SharePoint as well, look at the video below how to create and what are the columns etc. You will notice that the interface is same as SharePoint Lists and also settings page is same so the learning curve is pretty small.
Microsoft Lists Issue Tracker Demo

2. Employee OnBoarding Template: Look at the video to understand what columns it has, this can be used for onboarding new employees or onboarding emoloyee transfers from one location to another or department

Microsoft Lists Onboarding template demo

3. Event Itinerary template demo: A lists to track series of events such as who is the speaker, location, number of people allowed etc, look at the video for more details

Microsoft Lists itinerary template demo

4. Asset Manager Template: This template can be used to manage assets if new assets needs to be assigned, transferred or an inventory of existing assets. All required columns like Serial number, manufacturer etc are already available, look at the video for more details

Microsoft Lists Asset Manager template demo

5. Recruitment Tracker: This template can be used to track recruitment candidates, has all options to store candidate information, who is the requester, for what role etc., look at the video to understand more.

Microsoft Lists Recruitment Tracker template demo

6. Travel Request Tracker: This can be used to track travel requests, it has all the columns you need, workflow of course can be created using Power Automate, good use of the “Location” column as users can enter location where they are travelling so you don’t need to maintain a list, flight cost, hotel cost etc, look at the video for details

Microsoft Lists Travel Tracker template demo

7. Work Progress Tracker: This template can be handy if you are managing a team or you are tracking different tasks, this template has all the columns you need such categorization, priority, start date , end date etc, look at the video for more details

Microsoft Lists Work Progress Tracker demo

8. Content Scheduler: This template can be used to track launch of content in your organization, it has all the columns you need such as Content type, author, publish date, content link etc, view the video to get more details

Microsoft Lists Content Scheduler template demo

Create a blank list: Use the same steps as before just use the option, blank list, it is more like a custom list we have in SharePoint and we can create columns as we wish. View the video for more details.

As you can see the experience is very similar as before and we have both modern way of creating ways also classic experience available with us, if you want to use metadata type it is also available.

Microsoft Lists Blank List demo

Create a List using an existing list: Use the same options as before just use the option existing list and you will be able to create a list out of an existing list. Benefit of this is that whatever customization with respect to columns, formatting and views you have done will be copied over. View the video for more details.

Create Microsoft Lists using an existing List

Create a List using an excel: If you have data in existing excel and you would like to turn it into Microsoft Lists then it can be easily done, view the video below.

Some points before you do this:

  1. There is a limit of number of rows for which data can be uploaded
  2. Your excel sheet needs to have data in “Table” format else it will not work and will give a message for the same.
  3. You can select multiple type of column type while uploading such as Single text, Multi text, Choice , Date time, Number , Currency depending on what data resides in the column or you can select not to upload data
  4. When you upload the excel it will be first uploaded to OneDrive and then list will be created, later it can be found in OneDrive.
  5. You have the ability to upload an excel from OneDrive as well.
  6. I also encountered an issue while uploading, I was not abe to save List under “My Lists” as it gave me this error “The Site does now allow Site Designs” so I had to share it in one of the SharePoint sites and then it worked.
  7. Your data along with columns will also be uploaded.

What happens when you create a list and how to create under SharePoint Site ?

If you will notice the List URL you will understand that the List App is actually running from your SharePoint My Site as we have our “OneDrive” running, a sample URL below so I believe all Lists are being created under your My Site. Check below URLs and you will understand. Anyhow our my sites are nothing but a SharePoint site so it makes sense to utilize them.

Main URL:

https://yourtenant-my.sharepoint.com/personal/tenant_com/_layouts/15/lists.aspx

A specific URL:

https://youtenant-my.sharepoint.com/personal/yourtenant_onmicrosoft_com/Lists/Listname/AllItems.aspx?env=WebViewList

You have the ability to save list under a SharePoint site when you create a list, instead of My Lists select SharePoint Site this will create the List under SharePoint site, a link will be added in menu automatically and also you can find under the Site Contents.

Create Microsoft Lists Under SharePoint Site

Create a List from existing SharePoint List: Yes this is true you can create Microsoft Lists using existing SharePoint List, check the below video for details. Basically you will have to use “From existing list” option and you can select SharePoint sites and it will show compatible Lists whuch can be used.

Create Microsoft Lists using SharePoint existing Lists

List formatting: List formatting is already available in same way as it is in SharePoint lists, you will also notice that for templates some columns already have formatting such as Progress column, for more information on Lists formatting visit here https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting and https://pnp.github.io/sp-dev-list-formatting/

Microsoft Lists formatting sample

How to create a Rule in Microsoft Lists: Rule is a great idea introduced by Microsoft which works similar to List formatting but has much more, check the video below in which I highlight a column and also add an exclaimation icon based on specific condition and that too only via few clicks.

Create Rule for Microsoft Lists demo

How to access Microsoft Lists via PowerShell?

You can access Microsoft Lists just like any other list and I hope all kind of commands work, check below the screenshot to believe it

Microsoft Lists access via PowerShell

Sharing options in Microsoft Lists: When you create Microsoft Lists under My Lists it is accessible only by you so if you want to share with others you need to share with other persons. When you create under a SharePoint site then it will be accessible by SharePoint site users as well.

Share options in Microsoft Lists

You can also share individual items as well.

Integration options: This is a big topic so I just want to say few lines as it has all the abilities for extending the functionality using Microsoft Graph, Power Automate, PowerApps

How to access normal SharePoint List in Microsoft Lists way:

If you want to see the new Microsoft Lists experience in any modern SharePoint list, go to the URL and append this query string after AllItems.aspx like this. AllItems.aspx?env=WebViewList

Credit goes to this tweet:

https://platform.twitter.com/widgets.js

Summary: This is a great decision from Microsoft to introduce Lists as a standalone App, it will provide a great value. It has huge capabilities which I have not been able to cover all things but I will do this in subsequent blogs.

Connect with me on Twitter or Linked In if you need more information.

References: https://aka.ms/mslists

How to call Microsoft Graph API from PowerShell to get Microsoft Teams details?

If you like my blog post please subscribe to my YouTube Channel “SYNK Ventures – Let’s talk about Microsoft 365” as well https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g?sub_confirmation=1

Let’s start with PowerShell script and then we can break it down, so here is a code which can get details of a team using Graph API.

There are bunch of parameters which you need to replace it with your own details and in this blog I will explain how to get those.

$clientId = "<<yourclientid>>"  
$clientSecret = "<<yourclientsecret>>"  
$tenantName = "<<yourteanantname">>  
$resource = "https://graph.microsoft.com/"  
$URL = "https://graph.microsoft.com/v1.0/teams/<<yourteamdid>>"  
  
  
$tokenBody = @{  
    Grant_Type    = "client_credentials"  
    Scope         = "https://graph.microsoft.com/.default"  
    Client_Id     = $clientId  
    Client_Secret = $clientSecret  
}   
  

$tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantName/oauth2/v2.0/token" -Method POST -Body $tokenBody  
Invoke-RestMethod -Headers @{Authorization = "Bearer $($tokenResponse.access_token)"} -Uri $URL

So let’s start with “yourclientid” and “yourclientsecret”, for these we need to login to Azure portal and do an “App Registration”. To call an Graph API you need an App to with correct access to resources.

URL to Azure portal: https://portal.azure.com/

Follow below steps to get the App Registration done:

  • Once you have logged into Azure portal, search for “App Registration” and click “New registration”
Azure App Registration
Azure New Registration
  • Give a name as you would like and click “Register”.
Register App in Azure
  • Important thing to note is Application (client) ID which you need to provide as <<yourclientid>>
App Registration Azure
  • Click on API permissions on left and click “Add a permission” and then select “Application permissions”.
API Permissions Graph
  • We have to give specific permissions so that we can read data, search for “group” and select “Read.All” as shown below and the click “Add Permissions”.
Add Permissions Azure API
  • Don’t forget to click “Grand admin consent for xxxx” else your API will not work
Add Permissions Azure Graph API
  • Next step is to create a secret so click “Certificates & secrets” on left menu. Click on “New Client Secret” and give a name and click Add, If it’s production better to select Expires as Never.
Certificates and Secrets Graph API
  • Once created please copy and keep it which will be our another pramater that is “<<yourclientsecret>>”.
Client Secret Graph API
Install-Module MicrosoftTeams
Import-Module MicrosoftTeams
$credentials=Get-Credential
Connect-MicrosoftTeams -Credential $credentials
Get-Team

So now we have got all the parameters so you can run the PowerShell by applying the values you have found and created and result will be like below

So this is a very basic example of calling Graph API from PowerShell and get details of Teams.

I will be writing another blog very soon to get all Apps used in Teams of a tenant which will be based on above concept.

Connect with me on Twitter or Linked In if you need more information.

References: