Search code examples
office365office365-restapi

Create Office 365 groups using client library programatically


I am trying to create Office 365 groups programatically. I found that there is one possible way to create Office 365 groups via REST API through Graph. I read that there will be Client Library for creating Office 365 groups, but I couldn't find much information. Does anyone created Office 365 groups using Client library. Please suggest.

Thanking in advance.


Solution

  • Install the Microsoft.Graph Nuget Package.

    Then, you can use the GraphServiceClient to create the service.
    Next, you simply use the client to pull whatever you need down.

    GraphServiceClient client = new GraphServiceClient(Iauthcontext provider or proxy);
    var me = client.me.request().getasync();   
    

    The hard work is in setting up the Authenticator, but if you search the we for samples with the GraphServiceClient, you will find many.