Last active
May 16, 2018 00:25
-
-
Save AsishP/a39da6038fa3d3d596d45d1a61d71483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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