Skip to content

Instantly share code, notes, and snippets.

Avatar

ryanjonhealy

  • Manchester, United Kingdom
View GitHub Profile
View ModernBranding.ts
export default class HelloWorldApplicationCustomizer extends BaseApplicationCustomizer {
private _externalJsUrl: string = "https://{yourtenant}.sharepoint.com/CDN/CustomStyling.css";
private _externalJsUrl2: string = "https://{yourtenant}.sharepoint.com/CDN/CustomScript.js";
private _externalJsUrl3: string = "https://{yourtenant}.sharepoint.com/CDN/jquery-3.3.1.min.js";
public onInit(): Promise {
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
// Added to handle possible changes on the existence of placeholders.
View findFeatureId.js
var featureCollection;
var oneFeature;
var site;
var guid
function findFeatureId() {
var clientContext = new SP.ClientContext();
site = clientContext.get_web();
clientContext.load(site);
featureCollection = site.get_features();
View activateFeature.js
function activateFeature(rawGuid){
//get contextr of newly created site
var clientContext = new SP.ClientContext($site_url);
web = clientContext.get_web();
//Activate Features
ActivateWebFeature(web);
function ActivateWebFeature(web){
//trinedy branding feature GUID
View get-splogevent.PS1
$guid = "d17a4766-5115-4be4-8138-9962885912bc"
Get-SPLogevent -starttime (get-date).addminutes(-65) | ?{$_.Correlation -eq $guid} | select Message | Format-table -property message-autosize
@ryanjonhealy
ryanjonhealy / Set AnhorId for Managed Metadata Fields to Taxonomy Term GUID.ps1
Last active August 29, 2015 14:21
Set AnhorId for Managed Metadata Fields to Taxonomy Term GUID
View Set AnhorId for Managed Metadata Fields to Taxonomy Term GUID.ps1
$siteColl = Get-SPSite -Identity "http://sp2013/sites/EDMS"
$spSite = [Microsoft.SharePoint.SPSite] ($siteColl)
$TaxSession = Get-SPTaxonomySession -Site $SiteCollection
$TermStore = $TaxSession.TermStores[“Managed Metadata Service”] #Change to your service name
$TermStore.Id
#Get the Term Set
$TermStoreGroup = $TermStore.Groups[“Functions”] #Change to your Terms Store group name -the main parent term
$TermSetList = $TermStoreGroup.TermSets
#create an array
$myArray = $TermSetList.Terms
@ryanjonhealy
ryanjonhealy / Create SP Sites based on Term Store.ps1
Last active August 29, 2015 14:21
Create SP Sites based on Term Store
View Create SP Sites based on Term Store.ps1
$web = get-spweb http://sp2013/sites/Root #Change to your site URL
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq “TemplateSite”} #Change to your template name
$SiteCollection = Get-SPSite http://sp2013/sites/Root #Change to your site URL
#Get the Term Store ID
$TaxSession = Get-SPTaxonomySession -Site $SiteCollection
$TermStore = $TaxSession.TermStores[“Managed Metadata Service”] #Change to your service name
$TermStore.Id
#Get the Term Set
$TermStoreGroup = $TermStore.Groups[“Functions”] #Change to your Terms Store group name -the main parent term
$TermSetList = $TermStoreGroup.TermSets
View GetUserNameIntoQueryString
function CustomExecuteFunction() {
var self = this;
self.context = new SP.ClientContext.get_current();
self.web = context.get_web();
self.currentUser = web.get_currentUser();
context.load(self.currentUser);
self.asyncSuccess = function(sender, args) {
var user = this.currentUser;
console.log('asyncSuccess', user);