Skip to content

Instantly share code, notes, and snippets.

View BradCandell's full-sized avatar

Brad Candell BradCandell

View GitHub Profile
@BradCandell
BradCandell / ClaimsTransformation.xml
Created March 1, 2021 14:25
Example of a Claims Transformation Technical Profile for converting the first and last names (givenName, surname) claims into a full name (displayName).
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0"
TenantId="tenant.onmicrosoft.com" PolicyId="B2C_1A_ClaimsTransformation"
PublicPolicyUri="http://tenant.onmicrosoft.com/B2C_1A_ClaimsTransformation" xmlns:PolicyDeployment="true"
xmlns:PolicyDeploymentOrder="3">
<BasePolicy>
<TenantId>tenant.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkBase</PolicyId>
<#
.SYNOPSIS
Creates a HTML Report describing the Exchange environment
Steve Goodman
THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
Version 1.6.2
@BradCandell
BradCandell / Test-DynamicParameters.ps1
Last active July 26, 2018 20:48
Example of issue with ValidateSetAttribute(s), Strings and Dynamic Parameters. When using AutoComplete in the ISE or Console, a dynamic parameter will "disappear" whenever a parameter value that is Validated contains spaces or periods.
function Test-DynamicParameters {
[CmdletBinding()]
Param(
[parameter(Mandatory = $true)]
[string]$Name,
[parameter(Mandatory = $true)]
[ValidateSet("192.168.1.15", "1600 Pennsylvania Avenue", "11 Wall St.", "221 B Baker Street", "NoSpaces")]
@BradCandell
BradCandell / RegistryExtensions.cs
Created December 1, 2015 15:17
Exports a Windows Registry Key to a TextWriter or File Path - Needs some exception handling and testing on 32-bit systems or systems that have different Endian values.
using System;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace RegistryExtension {
public static class RegistryExtensions {