Skip to content

Instantly share code, notes, and snippets.

Bill Long bill-long

Block or report user

Report or block bill-long

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am bill-long on github.
  • I am bill_long (https://keybase.io/bill_long) on keybase.
  • I have a public key ASB1qPGk7xPfX491VE-Q7v0yhRCpAIgKXZNOEVA8EoCZTAo

To claim this, I am signing this object:

View SetupServer.ps1
<#
Examples
Create a DC:
iex ((New-Object System.Net.WebClient).DownloadString('https://gist.github.com/bill-long/04f2e34143553ea3ee35e3322170559b/raw'))
SetupServer -ComputerName LAB7DC1 -IpAddress "10.7.0.1" -PrefixLength 8 -Gateway "10.0.0.1" -DnsServer "10.0.0.1" -DomainName "bilonglab7.com" -MakeForest
Create an Exchange server:
View SetPFDiscoveryMailbox.ps1
# SetPFDiscoveryMailbox.ps1
#
# Syntax:
#
# $mailboxes = Get-Mailbox | .\SetPFDiscoveryMailbox.ps1
#
# You can use the usual parameters to filter the mailbox result, such
# as only returning mailboxes for a certain server:
#
# $mailboxes = GetMailbox -Server EXCH1 | .\SetPFDiscoveryMailbox.ps1
View Dump-InternetMessageIds.ps1
#########################################
# Dump-InternetMessageIds.ps1
#
param([string]$HostName, [string]$UserName, [string]$Mailbox, [string]$InputFile)
#########################################
# Update the path below to match the actual path to the EWS managed API DLL.
#
@bill-long
bill-long / PublicFolderCalendarBind.ps1
Created Sep 6, 2018
Reproduce an error binding to a calendar public folder
View PublicFolderCalendarBind.ps1
#####
# Change as needed
$folderPath = "\Bill\Some Calendar"
$user = "bill@contoso.com"
#
#####
Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll"
$password = $host.ui.PromptForCredential("Credentials", "Please enter your password to authenticate to EWS.", $user, "").GetNetworkCredential().Password
$exchService = new-object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2016)
View Compare-GroupMembership.ps1
# Compare-GroupMembership.ps1
#
# Compares group membership across all GCs to verify replication.
param($Alias)
$forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$allGCs = $forest.FindAllGlobalCatalogs()
$dictionary = New-Object 'System.Collections.Generic.Dictionary[string, System.Collections.Generic.HashSet[string]]'
foreach ($gc in $allGCs) {
View AlternateMailboxMapGenerator.ps1
# AlternateMailboxMapGenerator.ps1
# by bilong@microsoft.com
# An alternative to PublicFolderToMailboxMapGenerator.ps1
param($sizeLimit, $inputFile, $outputFile)
Add-Type @"
using System;
using System.Collections.Generic;
public class FolderInfo {
View MailboxMapSizeCheck.ps1
# MailboxMapSizeCheck
param($folderSizeFile, $mailboxMapFile)
$folderSizes = Import-Csv $folderSizeFile
$mailboxMap = Import-Csv $mailboxMapFile
$mailboxSizes = New-Object 'System.Collections.Generic.Dictionary[string, long]'
foreach ($folder in $folderSizes)
{
View Test-EWSEndpoints.ps1
# Syntax:
# Test-EWSEndpoints someuser@contoso.com
param($emailAddress)
Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll"
$urls = New-Object 'System.Collections.Generic.List[string]'
# Update these URLs to reflect the URLs you want to test
View Check-UnresolvedSids.ps1
# Check-UnresolvedSIDs.ps1
#
# This script will remove all unresolved SIDs from public folder permissions.
# This will take quite some time to run against a large hierarchy.
param([string]$Server, [bool]$Remove)
if ([System.String]::IsNullOrEmpty($Server))
{
"You must specify a server."
You can’t perform that action at this time.