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
Connect-SPOService "https://[tenant]-admin.sharepoint.com" | |
Connect-PnPOnline "[siteurl]" | |
Set-SPOSite "[siteurl]" -DenyAddAndCustomizePages 0 | |
Set-PnPPropertyBagValue -Key "[propertyName]" -Value "[propertyValue]" -Indexed | |
Set-SPOSite "[siteurl]" -DenyAddAndCustomizePages 1 |
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); |
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
var group = UnifiedGroupsUtility.ListUnifiedGroups(token, mailNickname: url).Where(result => result.MailNickname.ToLower().Equals(alias.ToLower())).First(); | |
// We received a group entity containing information about the group | |
string groupurl = group.SiteUrl; | |
string groupId = group.GroupId; | |
string mailNickName = group.MailNickname; |
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
const string spTenantUrl = "https://<tenantname>-admin.sharepoint.com/"; | |
using (var contextTenant = new ClientContext(spTenantUrl)) | |
{ | |
contextTenant.Credentials = new SharePointOnlineCredentials(userName, secpass); | |
Tenant tSP = new Tenant(contextTenant); | |
tSP.SetSiteAdmin(groupurl, userName, true); | |
contextTenant.ExecuteQuery(); | |
} |
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
{ | |
"http": { | |
"routePrefix": "api", | |
"maxOutstandingRequests": -1, | |
"maxConcurrentRequests": 1, | |
"dynamicThrottlesEnabled": false | |
} | |
} |
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
UnifiedGroupsUtility.UpdateUnifiedGroup(group.GroupId, token, groupLogo: <logo url>, | |
members:<Members email array>, isPrivate: <boolean>, retryCount: <numberofretries>); |
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
return processComplete | |
? req.CreateResponse(HttpStatusCode.OK, "Success") | |
: req.CreateResponse(HttpStatusCode.Accepted, "Error"); |