This file contains hidden or 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
param( | |
[string]$proxyIp = '10.1.5.4', | |
[string]$proxyHttpPort = '8080', | |
[string]$proxyHttpsPort = '8443', | |
[string]$localDomainFqdn = 'contoso.local' | |
) | |
$proxy = 'http={0}:{1};https={0}:{2}' -f $proxyIp, $proxyHttpPort, $proxyHttpsPort | |
$bypasslist = '*.{0};<local>' -f $localDomainFqdn | |
# Set WinHTTP proxy |
This file contains hidden or 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
# Variables to edit | |
$certificateSubjectName = "certificateSubjectName" | |
$certificatePath = "certificatePath" | |
$certificatePassword = "certificatePassword" | |
# Creates the self signed certificate | |
$certificate = New-SelfSignedCertificate -DnsName $certificateSubjectName -CertStoreLocation "cert:\CurrentUser\My" ` | |
-NotAfter (Get-Date).AddYears(10) -FriendlyName $certificateSubjectName | |
if ($null -ne $certificate) { | |
# Exports the certificate's public key |
This file contains hidden or 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.SharePoint.Administration; | |
using Microsoft.SharePoint.Administration.Claims; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace InspectUsersId | |
{ | |
class UserAccount | |
{ |
This file contains hidden or 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
# loads "Microsoft.Identity.Client.dll" from module "PnP.PowerShell" | |
$moduleName = "PnP.PowerShell" | |
$module = Get-InstalledModule -Name $moduleName -ErrorAction SilentlyContinue | |
if ($null -ne $module) { | |
$modulePath = $module.InstalledLocation | |
} else { | |
$module = Get-Module -ListAvailable -Name $moduleName | |
if ($null -eq $module) { | |
Write-Host -ForegroundColor Red "Module '$moduleName' was not found, install it by running 'Install-Module -Name $moduleName'"; return; | |
} |
This file contains hidden or 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
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t ' # Shell uses IFS to determine the field separators. Use the space ' ' to split param_rgNames to an array | |
# -e: immediately exit if any command has a non-zero exit status | |
# -u: immediately exit if using a variable not previously declared | |
# -o: prevents errors in a pipeline from being masked | |
usage() { echo "Usage: $0 -u <servicePrincipal-id> -s <servicePrincipal-secret> -t <tenant-id> -g '<rgName1 rgName2 rgName3>';" exit 1; } | |
: ' |
This file contains hidden or 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
#!/usr/bin/env python | |
# This script parses log files generated by the Azure DSC extention to compute the time taken by each resource to apply its configuration. | |
# It prints the result and generates an output.csv file in the path specified | |
# Logs of the Azure DSC extention are typically located in C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.83.1.0 | |
# For each resource, it detects the End Set with the time taken, as below: | |
# VERBOSE: [2025-01-17 10:21:04Z] [VERBOSE] [SP]: LCM: [ End Set ] [[cChocoPackageInstaller]InstallAzureDataStudio] in 9.5250 seconds. | |
# VERBOSE: [2025-01-17 10:21:48Z] [VERBOSE] [SP]: LCM: [ End Set ] [[ADObjectPermissionEntry]GrantReplicatingDirectoryChanges] in 0.2660 seconds. |
This file contains hidden or 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.Claims; | |
using Microsoft.SharePoint.Administration; | |
using Microsoft.SharePoint.Administration.Claims; | |
using System; | |
using System.Diagnostics; | |
namespace ConsoleApplication1 | |
{ | |
/// <summary> | |
/// Migrate Windows users to be trusted from a specific SPTrustedLoginProvider |