Skip to content

Instantly share code, notes, and snippets.

@AsishP
Last active May 16, 2018 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsishP/a39da6038fa3d3d596d45d1a61d71483 to your computer and use it in GitHub Desktop.
Save AsishP/a39da6038fa3d3d596d45d1a61d71483 to your computer and use it in GitHub Desktop.
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using OfficeDevPnP.Core;
using OfficeDevPnP.Core.Framework.Graph;
using OfficeDevPnP.Core.Pages;
const string authString = "https://login.microsoftonline.com/<tenant domain>/";
const string clientId = "<Graph App ID>";
const string clientSecret = "<Graph App Secret>";
var authenticationContext = new AuthenticationContext(authString, false);
ClientCredential clientCred = new ClientCredential(clientId, clientSecret);
AuthenticationResult authenticationResult = await authenticationContext.AcquireTokenAsync(resourceId, clientCred);
string token = authenticationResult.AccessToken;
var groupNew = UnifiedGroupsUtility.CreateUnifiedGroup(<projectUniqueAlias>, <SharePoint Site Title>,
<URL>, token, owners: <Owners email Array>, members: <Owners email Array>,
groupLogo: <logo url>, isPrivate: <boolean>, retryCount: <numberofretries>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment