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 System; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.Cosmos; | |
public class Program | |
{ | |
public static async Task Main() | |
{ |
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
function Get-TenantDefaultName { | |
<# | |
.SYNOPSIS | |
Returns the Default and Root Tenant name. | |
.DESCRIPTION | |
Returns the Default and Root Tenant name. | |
.EXAMPLE |
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
export ARM_SUBSCRIPTION="[SUBSCRIPTION_ID]" | |
export ARM_CLIENT_SECRET="[CLIENT_SECRET]" | |
export ARM_CLIENT_ID="[CLIENT_ID" | |
export ARM_TENANT_ID="[TENANT_ID]" | |
echo $ARM_SUBSCRIPTION | |
echo $ARM_CLIENT_ID | |
echo $ARM_CLIENT_SECRET | |
echo $ARM_TENANT_ID |
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
$SourceAccountName = "[SOURCEACCOUNTNAME]" | |
$SourceContainer = "[SOURCECONTAINERNAME]" | |
#Read and List | |
#Ensure SourceBlobSAS is in single and double quotes for PowerShell | |
$SourceBlobSAS = '"[SOURCESAS]"' | |
$DestinationAccountName = "[DESTINATIONACCOUNTNAME]" | |
$DestinationContainer = "[DESTINATIONCONTAINERNAME]" | |
#Full Access | |
#Ensure DestinationBlobSAS is in single and double quotes for PowerShell | |
$DestinationBlobSAS = '"[DESTINATIONSAS]"' |
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
$SourceAccountName = "[SOURCEACCOUNTNAME]" | |
$SourceContainerName = "[SOURCECONTAINERNAME]" | |
$SourceBlobSAS = "[SOURCESAS]" | |
$DestinationAccountName = "[DESTINATIONACCOUNTNAME]" | |
$DestinationContainerName = "[DESTINATIONCONTAINERNAME]" | |
$DestinationBlobSAS = "[DESTINATIONSAS]" | |
$SourceContainerURL = "https://$SourceAccountName.blob.core.windows.net/$SourceContainerName" | |
$DestinationContainerURL = "https://$DestinationAccountName.blob.core.windows.net/$DestinationContainerName" |
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
<# | |
.SYNOPSIS | |
Need to use PowerShell version 7.1 | |
PNP needs to be above version 1.4 | |
Need to use the new PNP.PowerShell "Install-Module PnP.Powershell" | |
Loops through Library obtaining all items that were modified either before or after a given date. | |
You need to connect to the site first using PNP | |
Connect-PnPOnline -url:https://[tenant].sharepoint.com/sites/[siteURL] -PnPManagementShell |
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
function Get-ListDataAsStream { | |
param ( | |
[Parameter(Mandatory)] | |
[string] | |
$SiteUrl, | |
[Parameter(Mandatory)] | |
[string] | |
$ListName, | |
[Parameter(Mandatory)] | |
[string] |
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
<# | |
.SYNOPSIS | |
Need to use PowerShell version 7.1 | |
Need to use the new PNP.PowerShell "Install-Module PnP.Powershell -MaximumVersion 1.2.0 -Scope:CurrentUser -Force" | |
Loops through Library obtaining all items. | |
You need to connect to the site first using PNP | |
Connect-PnPOnline -url:https://beisgov.sharepoint.com/sites/[siteURL] -PnPManagementShell |
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
<# | |
.SYNOPSIS | |
Creates a service connection for a ManagementGroup | |
Please ensure you are already logged to azure using az login | |
#> | |
param( | |
# Azure DevOps Personal Access Token (PAT) for the 'https://dev.azure.com/[ORG]' Azure DevOps tenancy | |
[Parameter(Mandatory)] | |
[string] | |
$PersonalAccessToken, |
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
$PersonalAccessToken = "<PAT TOKEN>" | |
$TeamProject = '<PROJECT NAME>' | |
$TeamFoundationCollectionUri = 'https://dev.azure.com/<organizationName >' | |
$AppRegistrationName = '<Service Principal Name>' | |
$AppPassword = '<Service Principal Secret>' | |
$AppSecurePassword = ConvertTo-SecureString -String:$AppPassword -AsPlainText -Force | |
.\Install-ServiceConnectionManagementGroup.ps1 -PersonalAccessToken $PersonalAccessToken ` | |
-TeamFoundationCollectionUri:$TeamFoundationCollectionUri ` | |
-TeamProject:$TeamProject ` |
NewerOlder