Skip to content

Instantly share code, notes, and snippets.

@daivagna
daivagna / gist:ad11901a8d2d32c7525559bff20aea21
Last active February 17, 2026 12:50
Export to excel of all sitecore items with their renderings and datasource
# Root path
$rootPath = "master:\sitecore\content\<<Tanent name>>\<<site name>>\Home"
# Get ALL items under Home, including children
$items = Get-Item -Path $rootPath | Get-ChildItem -Recurse
echo $items
$exportData = @()
foreach ($item in $items) {
# Collect page fields
@daivagna
daivagna / UserMigration.txt
Last active April 23, 2024 10:22
User Migration Script
-----------------------------------------------------------------------------------------------------------------
INSERT INTO dbo.aspnet_Membership
SELECT [ApplicationId],
[UserId],
[Password],
[PasswordFormat],
[PasswordSalt],
[MobilePIN],
[Email],
[LoweredEmail],
@daivagna
daivagna / Azure_external_tables_scripts.txt
Last active April 23, 2024 10:21
Create master key for external tables for cross db scripting.
/*
[aspnet_Membership]
[aspnet_Profile_CDB]
[aspnet_WebEvent_Events]
When you use insert into query, above table's columns will need to be converted to nvarchar instead of ntext for some fields
*/
/* ############# Below section only needs to be run once ###################*/
CREATE MASTER KEY ENCRYPTION BY PASSWORD='hztl@9999'
CREATE DATABASE SCOPED CREDENTIAL crossdbcred2
WITH
@daivagna
daivagna / Leprechaun.config
Last active November 7, 2023 13:41
Leprechaun configuration file
<?xml version="1.0" encoding="utf-8" ?>
<!--
GETTING STARTED WITH LEPRECHAUN
1. Make a COPY of this file to store your base Leprechaun configuration.
- This file should go in source control.
- It can go anywhere under your project, in some global location (like say /src)
2. Alter the Sample.Base configuration below, in your copy, to define the model conventions of your project.
- Where to find serialized item files