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
@bill-long
bill-long / Fix-DelegatedSetup.ps1
Last active Aug 29, 2015
In Exchange 2013, delegated setup will fail if legacy administrative groups exist. This script will add an explicit deny for the Delegated Setup group to allow setup to work. The script can be run again once setup is complete to remove the deny.
View Fix-DelegatedSetup.ps1
# Fix-DelegatedSetup.ps1
#
# In Exchange 2013, delegated setup fails if legacy admin groups still exist. However,
# it's recommended that these admin groups not be deleted. To make delegated setup work,
# you can temporarily place an explicit deny so that the Delegated Setup group
# cannot see them. This script automates that process.
#
# This script takes no parameters. The syntax is simply:
# .\Fix-DelegatedSetup.ps1
#
@bill-long
bill-long / Create-BigObjects.ps1
Created Mar 20, 2014
The purpose of this script is to create some very large user objects in order to hit the LDAP send queue limit in Active Directory using this tool: https://github.com/bill-long/LdapSendQueueTest
View Create-BigObjects.ps1
# Create-BigObjects.ps1
$dcName = "DC1"
$domain = "DC=bilong,DC=test"
$bigObjectContainer = "BigObjects"
Import-Module ActiveDirectory
$adModule = Get-Module | WHERE { $_.Name -eq "ActiveDirectory" }
if ($adModule -eq $null)
{
View Fix-MailEnabled.ps1
# Fix-MailEnabled.ps1
#
# The purpose of this script is to read an ExFolders or PFDAVAdmin
# property export of public folders, and fix the folders where the
# mail-enabled state is not consistent.
#
# The export must include the following properties:
# PR_PF_PROXY, PR_PF_PROXY_REQUIRED, DS:proxyAddresses
#
# The export can optionally include the following
@bill-long
bill-long / RegexFileSearch.ps1
Last active Aug 29, 2015
Search text files for a given regular expression. This is for when findstr won't cut it due to its limited regexp support.
View RegexFileSearch.ps1
param(
[Parameter(Position=0, Mandatory=$true)]
[string] $Pattern,
[Parameter(Position=1, Mandatory=$false)]
[string] $File,
[Parameter(Mandatory=$false)]
[string] $Directory,
[Parameter(Mandatory=$false)]
[string] $FileFilter,
[Parameter(Mandatory=$false)]
@bill-long
bill-long / Check1216Errors.ps1
Last active Aug 29, 2015
Point this to a Directory Service log in CSV format, and it counts each unique 1216 event and tells you how many times that particular type of 1216 event occurred.
View Check1216Errors.ps1
param($file)
$reader = new-object System.IO.StreamReader($file)
$errorsDictionary = new-object 'System.Collections.Generic.Dictionary[string,int]'
$nextLineIsError = $false
while ($null -ne ($buffer = $reader.ReadLine()))
{
if ($nextLineIsError)
{
$nextLineIsError = $false
@bill-long
bill-long / CheckToDoSearch.ps1
Created May 30, 2014
Check search criteria on To-Do Search folder
View CheckToDoSearch.ps1
#########################################
# GenericDoAllMailboxFoldersScript.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 / Delete-Folder.ps1
Created Jul 4, 2014
This script uses Microsoft.Experimental.IO.dll (see http://bcl.codeplex.com/wikipage?title=Long%20Path) to delete folders which contain files where the path exceeds 260 characters. This script recursively deletes all files and folders in the specified folder.
View Delete-Folder.ps1
param($folder)
$ExperimentalIOBinary = 'C:\Users\administrator\Desktop\Microsoft.Experimental.IO.dll'
[System.Reflection.Assembly]::LoadFile($ExperimentalIOBinary)
function DeleteAllFilesRecursive($path)
{
"Getting folders in folder: " + $path
$subfolders = [Microsoft.Experimental.IO.LongPathDirectory]::EnumerateDirectories($path)
foreach ($subfolder in $subfolders)
@bill-long
bill-long / Delete-Folder.ps1
Created Jul 9, 2014
A Powershell script to delete folders that contain files and directories exceeding the MAX_PATH limit on Windows. Requires Microsoft.Experimental.IO.dll, which can be downloaded from Codeplex: http://bcl.codeplex.com/wikipage?title=Long%20Path
View Delete-Folder.ps1
param($folder)
$ExperimentalIOBinary = 'C:\Users\administrator\Desktop\Microsoft.Experimental.IO.dll'
[System.Reflection.Assembly]::LoadFile($ExperimentalIOBinary)
function DeleteAllFilesRecursive($path)
{
"Getting folders in folder: " + $path
$subfolders = [Microsoft.Experimental.IO.LongPathDirectory]::EnumerateDirectories($path)
foreach ($subfolder in $subfolders)
@bill-long
bill-long / Resolve-SIDs.ps1
Created Nov 19, 2014
Script for testing the reliability of SID resolution.
View Resolve-SIDs.ps1
# Resolve-SIDs.ps1
#
# Resolve a bunch of SIDs from a text file, in a loop.
param($file)
$sids = New-Object 'System.Collections.Generic.List[string]'
$reader = New-Object System.IO.StreamReader($file)
while ($null -ne ($buffer = $reader.ReadLine()))
{
View RemoveProperty.ps1
#################################################################################
# RemoveProperty.ps1
#
# Removes property 0x3FC9 from public folders.
param([string]$FolderPath, [string]$HostName, [string]$UserName, [boolean]$Recurse, [boolean]$Fix)
#################################################################################
# Update the path below to match the actual path to the EWS managed API DLL.
#
You can’t perform that action at this time.