Skip to content

Instantly share code, notes, and snippets.

$terminal0 = New-PSSession Terminalmaster
$terminal1 = New-PSSession Terminal1
$terminal2 = New-PSSession Terminal2
$terminal3 = New-PSSession Terminal3
$terminal4 = New-PSSession Terminal4
$terminal5 = New-PSSession Terminal5
function Disable-MigrationTasks{
$migrationDataFolder = '\\masterterminal\c$\AutomatedMigrationData'
$mailFolder = 'mails'
$inputFolder = 'input'
$processingFolder = 'processing'
$finalFolder = 'final'
function SendMail{
#Install-Module SharePointPnPPowerShellOnline -AllowClobber -Force
#Update-Module SharePointPnPPowerShell*
Import-Module Sharegate
$credentials = &'\\masterterminal\C$\AutomationScripts\GetCredentials.ps1'
$migrationDataFolder = '\\masterterminal\c$\AutomatedMigrationData'
$packagesFolder = 'packages'
$mailFolder = 'mails'
$reportsFolder = 'reports'
$credentials = 'D:\codes\AutomationScripts\GetCredentials.ps1'
$migrationDataFolder = '\\masterterminal\c$\AutomatedMigrationData'
$packagesFolder = 'packages'
$mailFolder = 'mails'
$reportsFolder = 'reports'
$inputFolder = 'input'
$processingFolder = 'processing'
$finalFolder = 'final'
$creds = & 'D:\codes\AutomationScripts\GetCredentials.ps1'
$listName = "Migrationsconfig"
Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/MigrationConfigurations -Credentials $creds
New-PnPList -Title $listName -Template GenericList -OnQuickLaunch
Add-PnPField -List $listName -DisplayName 'Source' -InternalName 'Source' -AddToDefaultView -Type Text -Group 'Custom' -Required
Import-Module Sharegate
#Get credentials from user
$credentials = Get-Credential -UserName migrationuser@yoursharepointtenant.onmicrosoft.com -Message 'Provide 0365 credentials'
#Sharepoint site root path
$migrationRoot = 'https://yoursharepointtenant.sharepoint.com/sites/'
function Migrate-List{
Param(
@VibhuKuchhal
VibhuKuchhal / BlogFilteredTemplate.xml
Created May 29, 2018 00:11
BlogFilteredTemplate.sgt - Sharegate migration template to filter required data
<?xml version="1.0"?>
<ArrayOfPropertyTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PropertyTemplate Id="d20ad53c-baa0-4ed0-b332-61d1fc5c05fa" ListId="e50a4ee3-1271-46d7-9bd4-5054707e19fd" Name="BlogFilteredTemplate" CheckInType="CopySource" ModerationStatusType="CopySource" KeepAuthorsAndTimestamps="true" CopyVersionHistory="true" CopyUserAlerts="false" CopyPermissions="true" CorrectLinks="true" FlattenFolders="false" CopyWebParts="true" TemplateType="Copy" ContentFrom="01/01/2016 08:00:00" HasVersionsLimit="false" VersionsLimit="5" ContentFileExtension="pdf; xlsx; xls; doc; pptx; docx; ppt; xlsm; rtf; vsd; pub; docm; xlsb; mpp; one; pps; dotx; dot; pot; xlk; vdx; pptm; xlt; xlam; potx; odt; xla; wk4; dic; dotm; xltm; xltx; onetoc2; vss; thmx; vsdx; xps; msg; eml; jpg; cr2; png; tif; psd; bmp; eps; ai; jpeg; gif; indd; dwg; svg; djvu; ico; wmf; dcx; emf; xpm; pdn; cam;" ContentFileExtensionFilterType="LimitTo">
<ContentTypes>
<Conten
@VibhuKuchhal
VibhuKuchhal / BlogAllDataTemplate.xml
Last active May 29, 2018 00:12
BlogAllDataTemplate.sgt - Sharegate migration template to migrate all data
<?xml version="1.0"?>
<ArrayOfPropertyTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PropertyTemplate Id="e5ed06fd-50bc-4418-b217-16fccdfeaabc" ListId="0357d9fe-7e48-4e75-9ee1-134b3df5a41a" Name="BlogAllDataTemplate" CheckInType="CopySource" ModerationStatusType="CopySource" KeepAuthorsAndTimestamps="true" CopyVersionHistory="true" CopyUserAlerts="false" CopyPermissions="true" CorrectLinks="true" FlattenFolders="false" CopyWebParts="true" TemplateType="Copy" HasVersionsLimit="false" VersionsLimit="5" ContentFileExtension="" ContentFileExtensionFilterType="AllExtensions">
<ContentTypes>
<ContentTypes ParentContentTypeId="0x0101" Name="Document">
<Columns>
<Columns Action="UseSource" ApplyActionToAllVersions="true" FieldType="Text" Name="Title">
<Value />
</Columns>
<Columns Action="UseSource" ApplyActionToAllVersions="true" FieldType="URL" Name="_ShortcutUrl">
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<WebPartPages:AllowFraming ID="AllowFraming" runat="server" />
<html>
<head>
$(function () {
var tenant, token;
//"http://localhost:9279/api/Authentication",
$.ajax({
url: "https://peoplepickerapp1.azurewebsites.net/api/Authentication",
dataType: "json",
type: "GET",
success: function (data) {