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 Microsoft.Owin.Infrastructure; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Notifications; | |
using Microsoft.Owin.Security.OpenIdConnect; | |
using Owin; | |
using Sitecore.Abstractions; | |
using Sitecore.Configuration; | |
using Sitecore.Data.Clones; | |
using Sitecore.Diagnostics; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Sitecore Purge API</title> | |
</head> | |
<body> | |
<h1>POST Request Example</h1> | |
<button id="purge-button">Purge</button> | |
<div id="response-panel" style="display: none;"></div> |
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
$userId = "<ObjectID of AAD User>" | |
$countOfGroupsToCreate = 300 | |
$groupNamePrefix = "testgroup" | |
for ($i = 0; $i -lt $countOfGroupsToCreate; $i++) | |
{ | |
$newGroup = (az ad group create --display-name "$groupNamePrefix-group$i" --mail-nickname "$groupNamePrefix-group$i" -o json) | ConvertFrom-Json | |
az ad group member add --group $newGroup.Id --member-id $userId | |
} |
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
SELECT TargetPageUrl, ContactId FROM [xdb_collection].[Interactions] | |
CROSS APPLY | |
OPENJSON([xdb_collection].[Interactions].[Events]) WITH | |
( | |
OdataType varchar(200) '$."@odata.type"', | |
MessageId varchar(200) '$.MessageId', | |
TargetPageUrl varchar(200) '$.Url' | |
) | |
WHERE | |
OdataType = '#Sitecore.EmailCampaign.Model.XConnect.Events.EmailClickedEvent' |
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
msdeploy.exe -Verb:Sync -Source:dbDacFx="C:\path\to\dacpac\Sitecore.Xdb.Collection.Shard0.dacpac" -Dest:dbDacFx="Data Source=sqlservername.database.windows.net;Database=shard0; User ID=sa; Password=hereissupersecretpassword" |
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
<%@ Page language="c#" %> | |
<%@ Import namespace="Microsoft.Extensions.DependencyInjection" %> | |
<script runat="server"> | |
void Page_Load(object sender, System.EventArgs e) { | |
var identificationManager = Sitecore.DependencyInjection.ServiceLocator.ServiceProvider.GetRequiredService<Sitecore.Analytics.Tracking.Identification.IContactIdentificationManager>(); | |
Sitecore.Analytics.Tracking.Identification.IdentificationResult result = identificationManager.IdentifyAs(new Sitecore.Analytics.Tracking.Identification.KnownContactIdentifier("directsource", "user_" + Guid.NewGuid())); | |
Sitecore.Analytics.Tracker.Current.EndTracking(); | |
Session.Abandon(); |
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 client = new RestClient("https://101.cm/sitecore/api/ssc/EXM/OpensClicks"); | |
client.Timeout = -1; | |
var request = new RestRequest(Method.POST); | |
request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); | |
request.AddHeader("Cookie", ".AspNet.Cookies=bgpR8QztTd9NZSUxslRERNisA0vfddxT2EPo6ntOWeLNTl_-ivEd5KrzdhUmSlQubeoG0wRrRhqCnK6anpbIvrShqzTE0GFedn9POFSJr3cUUjN-ZNiUldGXecBBX3q-TN-cODWap-ReuekxmaK-_xMeev_kGT2W10PhPPc6axLf73juAPp9vvsVZaBzofPjiO6bexAm405zAZi05gqfJEZL27Ga9ykriJTvWUbR0SCO8UD_DF7DWFVbEprbpdjoDixVI1BcE3D_Z54SI1o0htmeJdfsAZp7W2gf8y17wZzNxBon1m7juM_wdvhIcsYSjjfqL-sk0f6JIMcLbspcnEFaY1frYyIoe3yjJCQU-FFIH44oIdIg5YvmhRRU-wlcweFgLt-4yBo1AGsw7ryQa1ADA8GRxBcfBPik16mPqDAaiRQoeIm0zqwV378456YwFJ1w_EPvTPJzqPwZ1KKrjASxMXIl-8qhjXUQfFHGq3ycqfGFV5OkVbEzty88K_zxzU4QRAXqVgBbwSWNuwBuY5T9zNPBO_I5tAckFmiuRsCbicvQApERfk6PQhMH0XFI6jSps3LPRGEe2qf_kaWKayB9rcui4yyr46AsTJtMd0-4JvYUlCRCiLJbSg2EaJZcqLk6fn4ihUCL9MQU0GJF6Sb4dNO_w5Ms3I0KuFaUZPBAT2PYTMTAQbFJAmQjkTO_G-qINZ3QPyYKUeqB1ESc12kRNkso-L5HVztk4cGvmtz_9lr3WZ4i2tIERX |
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
$csvFile = Get-Item "C:\path-to-csv-file.csv" | |
$stateDescriptions = Import-Csv $csvFile -Delimiter ';' | Select-Object Target.StateDescription | |
$result1 = @() | |
foreach($desc in $stateDescriptions) | |
{ | |
# searching for filename with extension here (example pattern match /123testfile.tif:) | |
$desc -match "\/(?<filename>[^\/]*\.\w+):" #"\/\d{6}_.+\.[a-z0-9]+:" | |
if($Matches.Count -gt 0) | |
{ |
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 source = document.getElementById("entry-template").innerHTML; | |
var template = Handlebars.compile(source); | |
var entityLoadedSubscription = options.mediator.subscribe("entityLoaded", function (entity) { | |
updateUI(entity); | |
var entitySavedEvent = Utils.format("entitySaved:{id}", { id: entity.systemProperties.id() }); | |
options._page.mediator.subscribe(entitySavedEvent, updateUI); | |
}); | |
function updateUI(entity){ |
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 Stylelabs.M.Sdk.Models.Base; | |
using Stylelabs.M.Sdk.Models.Base.PropertyDefinitions; | |
using Stylelabs.M.Sdk.WebClient; | |
using Stylelabs.M.Sdk.WebClient.Authentication; | |
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace SchemaModification | |
{ |
NewerOlder