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

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:

SharePoint Spaces – my take on practical usage

To be honest when SharePoint Spaces was announced I had thought what can be practical usage of this but now I after using it in preview mode I can understand the usage part of this as well.

I must admit SharePoint Spaces is really cool to use and I have never thought I would see Augmented Reality in SharePoint but like all things nothing is impossible.

There are nice practicle samples provided by Microsoft SharePoint which you can find here https://www.exploresharepointspaces.com/samples but my example is a simple and scale down one.

This based on my experience with a customer I have worked with for many years.

I would like to create “Product Catalog” to display 3D images for the product and display relevant documents related to the Product.

To set some context: Large product / euiqpment manufacturing comapanies such as mining, construction or vechiles upload there marketing material for sales people to be accessed internally and share externally for sales pitch when needed on portal sites.

In general in these portal sites you will find images of the product and documents related to it in OOB user interface or custom user interface.

Companies also have product 3D images but they don’t show on intranet as SharePoint Spaces was not available so not so practical I would say.

Now we have set the context let’s check how easy is to use SharePoint Spaces.

  • First of all you need a SharePoint Site preferably a Communication site as it will give you more space in screen to create SharePoint Spaces.
  • Spaces is not available automatically and feature needs to be enabled in “Manage Site Features” called “Spaces”.
  • Once you have enabled it you will see below option in “New”
SharePoint Spaces new option
  • Select a structure , input a name to create a Space Design page which will look like below depending on which structure you have selected
SharePoint Space Design Page
  • Click on “+” to add 360 degree image, video etc shown as below
Add SharePoint Spaces
  • I will be adding a two Product groups like Trucks and Cars, which will take user to two different Spaces page which will contain different Trucks and Cars, you can imagine this as Product group and when you click you go to different Products available under that group.
  • I will add a 3D Object with Podium , please check below screen shots
  • The properties which I have used are “Podium”, “Link to another space” , “Alternate text” and “Description”.
  • The “Link to another space or link” is great option as you can hierarchy and structure around Spaces.
  • I will be adding another Space which display multiple Products and then each product will also link to another Space which will have a Document Library attached
  • This will complete our Product Catalog so it works like this Product Group –> Products –> Document Library (Space)
  • Now let’s see the whole set up in action
SharePoint Spaces in action
  • During the process of creating this I found some improvement areas or issues
    • If you have only folders in a document library then the SharePoint Spaces cannot load it
    • If you want to connect a object to a folder in library you have to use a “Link” option and the link to Folder will not be recognized which you get from “Copy Link” option so you have to construct on your own which will also be not recognized but it will work
    • If you have done connections using SharePoint Spaces then the page does not reload but Space area reloads which is good but it will be good to have some kind of hirearchy navigation which can help in contructing structures
  • Another thing I would like to add is that it works in Microsoft Teams as well
Teams and SharePoint Spaces

I think SharePoint Space has lot of practical usage you just need to think in different way and visualize.

Let me know what you think and what pratical usages to you can see.

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

References and links:

https://support.office.com/en-us/article/sharepoint-spaces-7b65edfb-7cc9-42e3-af37-178d79364a5e

https://www.exploresharepointspaces.com/

https://www.linkedin.com/posts/danielando_linkedin-sharepointspaces-microsoftteams-activity-6671180202351050752-u6S0

Microsoft 365 App – Bookings – A walkthrough

You must have booked an online appointment on sites for small businesses or salon or some kind of services but did you know that there is an service provided by Microsoft 365 as well for these kind of bookings. Although it has been around since 2016 it was made available for all E3 and E5 licenses recently.

I must say that Bookings App / service is very easy and intuitive to use, let’s have a quick walkthrough first and then we can look into some scenarios where it can be useful.

  • Booking page: Page is configurable in all aspects such as how booking page can be accessed, some text about data usage and control, scheduling policy, how to notify users, color theme of page. Check a screenshot below
  • Customers: You can add customers or import them as well
  • Staff: You can add staff and their availability schedule
  • Services: You can add what kind of services you provide
  • Business information: You can add more than one Business
  • You can create booking page which can be only accessed internally in organization
  • Customize email notifications
  • You can share booking socially and you can also disable the option if you want
  • Reports: You can download data upto 120 days
  • Booking is also available as an App in Microsoft Teams which makes it easy to use for organizations
  • Data can be accessed via Graph API if you want to build applications or further extend functionalities, read more here https://docs.microsoft.com/en-us/graph/api/resources/booking-api-overview?view=graph-rest-beta

Overall very rich functionalities and will meet your needs. Ability to access data via Graph API enables lot of possibilities.

Bookings App in Microsoft Teams

In general Microsoft 365 Bookings can be used by enterprise, small companies, shops to enable bookings in their public facing sites but apart from this it can be used internally by enterprises for various purposes.

  • Appointments for Service Desk kiosks
  • Appointments with HR for queries
  • Appointments with finance for resolutions

This was a quick walkthrough of Bookings in Microsoft 365.

If you want to try out Bookings I have created a demo which you can utilize

https://outlook.office365.com/owa/calendar/Test@cgikislay.onmicrosoft.com/bookings/

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

Resources and references:

https://techcommunity.microsoft.com/t5/microsoft-bookings-blog/you-can-now-do-more-with-microsoft-bookings/ba-p/298461

https://techcommunity.microsoft.com/t5/microsoft-bookings-blog/bg-p/Office365BusinessAppsBlog

https://www.microsoft.com/en-us/microsoft-365/business/scheduling-and-booking-app

https://docs.microsoft.com/en-us/graph/api/resources/booking-api-overview?view=graph-rest-beta

Microsoft 365 Lists – a powerful App, SharePoint lists not needed any more

Microsoft Build 2020 came up with lot of exciting announcements but the most interesting one was Lists as individual app in Microsoft 365.

Lists has been around for many years as part of SharePoint platform , I remember explaining my end users Lists is something like an excel rows or table in database in SharePoint 2010 days and to be frank not a lot has been changed, we have not seen huge improvements except some more templates being introduced. We got conditional formatting recently in SharePoint online, of course you can do more these days due to introduction of Power Platform (Power Apps and Automate).

This is reason I term this annoucement as interesting one as it takes the Lists to another level and put it on same level as other standalone apps.

So let’s look what all we get in Microsoft 365 Lists

  • It can be accessed as a standalone app from waffle of Micorosft 365
  • Various default predefined templates such as issue tracker, asset tracking, blank , contacts, inventory, events, onboarding etc are available
  • Lists has its own home page
  • Available as mobile app
  • Can be added to Microsoft Teams as an App or tab
  • Can have conversation around Lists in Microsoft Teams or can have conversation around each item in a Microsoft Lists
  • Lists will have views calendar, grid, custom, cards etc
  • Conditional formatting is available in Lists
  • Rules: You can set rules to show hide columns based on differen rules, it’s like light weight customizing forms, for definition read below statement
    • Building rules is as easy as writing a sentence. Once you decide on the outcome, click-fill if/then steps to design your rules. Choose people, status, and value changes to send notifications or programmatically update values elsewhere in the list. Finally, use rules to set reminders to keep everyone informed.
  • Lists can be shared with users so you can manage permissions and you can be owner of lists
  • You can boomark Lists using the favorites feature
  • Can create a new list from existing excel data
  • Able to preview a list before it is created
  • You can chose an icon and a color for you lists to make distinctions between different lists
  • Lists can be saved as draft till you are ready to share with others
  • You can comment on individual list items and also mention someone
  • You can design your own card views
  • Data availability and accessibility via Graph API

As you can read it has lots of features and covers a lot of scenarios which were not possible before in SharePoint lists so let’s have a look into them

  • Rule based email sending capabilities, earlier we used to write workflow or event receivers or Flows
  • Grid or card views , earlier we used to customize using JSLink, Jquery, JS etc
  • Earlier a whole site has to be created even though only a list was needed
  • In past following requests had come to be from business users which are avaialble by default now
    • Save as draft before it is ready to be released
    • Different icons to visualize it better
    • Simple form customziations can be done by Rules earlier we had to inject JS in edit, new or view forms

We can clearly infer that Microsoft 365 Lists are smart, powerful and easily replace SharePoint lists so we don’t need them anymore. With ability to add this in Teams we can see it is more flexible and very well integrated in Microsoft 365.

We can also infer that a need of Teams sites in SharePoint is even less now and if you are using Microsoft Teams along with Lists probably you don’t need SharePoint team sites.

As as ending note I am really forward to this new app which will be extremely useful and I would like to move most of SharePoint list to new Microsoft 365 Lists.

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

References

https://techcommunity.microsoft.com/t5/microsoft-365-blog/announcing-microsoft-lists-your-smart-information-tracking-app/ba-p/1372233 https://resources.techcommunity.microsoft.com/microsoft-lists/