This file contains hidden or 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
Write-Output "COB-O365-Group-VSCode: PowerShell Timer trigger function executed at:$(get-date)"; | |
$currentDate = Get-Date -Format "ddd_dd_MM_hh_mm" | |
$groupPrefix = "COB_AutoCreatedGroup___" | |
$groupName = $groupPrefix + $currentDate | |
Write-Output "Will attempt to create group with name '$($groupName)'" | |
$appid = $env:AppID | |
$client_secret = $env:AppSecret |
This file contains hidden or 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
Write-Output "COB-O365-Group-Creator: PowerShell function executed at:$(get-date)" | |
$appid = "[TODO - ENTER YOUR APP ID HERE]" | |
$client_secret = "[TODO - ENTER YOUR APP SECRET KEY HERE]" | |
$tenant = "[TODO - ENTER YOUR TENANT PREFIX HERE].onmicrosoft.com" | |
$currentDate = Get-Date -Format "ddd_dd_MM" | |
$groupPrefix = "COB_AutoCreatedGroup___" | |
$groupName = $groupPrefix + $currentDate |
This file contains hidden or 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
ClientContext adminSiteContext = new ClientContext(TENANT_ADMIN_URL); | |
adminSiteContext.Credentials = new SharePointOnlineCredentials(TENANT_ADMIN_USER, securePwd); | |
Web templateWeb = adminSiteContext.Web; | |
adminSiteContext.Load(templateWeb, w => w.Title, w => w.Url); | |
adminSiteContext.ExecuteQueryRetry(); | |
Console.WriteLine("Auth'd to site: " + templateWeb.Url); | |
// create new site collection.. | |
Tenant tenant = new Tenant(adminSiteContext); |
This file contains hidden or 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
XMLTemplateProvider provider = new XMLFileSystemTemplateProvider(TEMPLATE_FILE_PATH, string.Empty); | |
ProvisioningTemplate template = provider.GetTemplate(TEMPLATE_FILE); | |
stopwatch = System.Diagnostics.Stopwatch.StartNew(); | |
try | |
{ | |
rootWeb.ApplyProvisioningTemplate(template); | |
stopwatch.Stop(); |
This file contains hidden or 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
<pnp:CustomActions> | |
<pnp:WebCustomActions> | |
<pnp:CustomAction Name="COB-SPFx-GlobalHeader" | |
Description="Adds a global header to the site" | |
Location="ClientSideExtension.ApplicationCustomizer" | |
Title="COB-SPFx-GlobalHeader" | |
ClientSideComponentId="[YOUR GUID HERE]" | |
Sequence="0" | |
Rights="" | |
RegistrationType="None" /> |
This file contains hidden or 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.SharePoint.Client; | |
using OfficeDevPnP.Core; | |
using OfficeDevPnP.Core.Entities; | |
using System; | |
using System.Linq; | |
namespace COB.SPFx.Extensions.Manage | |
{ | |
/// <summary> | |
/// Console app code to add/remove/list SPFx Application Customizer extensions.. |
This file contains hidden or 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
$credentials = Get-Credential | |
# details of sites | |
[string[]] $sitesToProcess = | |
"https://chrisobriensp.sharepoint.com/sites/team1", | |
"https://chrisobriensp.sharepoint.com/sites/team2", | |
"https://chrisobriensp.sharepoint.com/sites/team3", | |
"https://chrisobriensp.sharepoint.com/sites/team4" | |
# details of custom action/SPFx extension |
This file contains hidden or 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
private loadUpcomingMeetings(): void { | |
this.setState((previousState: IUpcomingMeetingsState, props: IUpcomingMeetingsProps): IUpcomingMeetingsState => { | |
previousState.loading = true; | |
return previousState; | |
}); | |
this.getGraphAccessToken() | |
.then((accessToken: string): Promise<IMeeting[]> => { | |
// start timer here.. | |
this._startTime = new Date(); |
This file contains hidden or 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
// start timer here.. | |
this._startTime = new Date(); | |
this.props.context.graphHttpClient.get(`v1.0/groups/${groupId}/events`, GraphHttpClient.configurations.v1).then((response: HttpClientResponse) => { | |
if (response.ok) { | |
return response.json(); | |
} else { | |
console.warn(response.statusText); | |
} | |
}).then((result: any) => { |
This file contains hidden or 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
AppInsights.trackPageView( | |
document.title, /* (optional) page name */ | |
window.location.pathname, /* (optional) page url if available */ | |
{ | |
userLogin: this.context.pageContext.user.loginName, | |
userDisplayName: this.context.pageContext.user.displayName, | |
isExternalGuest: this.context.pageContext.user.isExternalGuestUser | |
}, /* (optional) dimension dictionary */ | |
{ }, /* (optional) metric dictionary */ | |
0 /* page view duration in milliseconds */ |