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 / Delete-TNEFProps.ps1
Last active Jan 4, 2016
Delete-TNEFProps.ps1 is a script intended to fix the Exchange Public Folder Replication issue described here: http://bill-long.com/2014/01/16/public-folder-replication-fails-with-tnef-violation-status-0x00008000/
View Delete-TNEFProps.ps1
#################################################################################
#
# The sample scripts are not supported under any Microsoft standard support
# program or service. The sample scripts are provided AS IS without warranty
# of any kind. Microsoft further disclaims all implied warranties including, without
# limitation, any implied warranties of merchantability or of fitness for a particular
# purpose. The entire risk arising out of the use or performance of the sample scripts
# and documentation remains with you. In no event shall Microsoft, its authors, or
# anyone else involved in the creation, production, or delivery of the scripts be liable
# for any damages whatsoever (including, without limitation, damages for loss of business
@bill-long
bill-long / Create-LotsOfPFs.ps1
Created Jan 26, 2014
Powershell script to create a lot of public folders for testing.
View Create-LotsOfPFs.ps1
# Create-LotsOfPFs.ps1
#
# Creates 10,000 public folders
function CreateFoldersRecursive($parentFolder)
{
$currentDepth++
for ($x = 1; $x -le $foldersPerLevel; $x++)
{
$thisFolder = New-PublicFolder ("Folder " + $x.ToString()) -Path $parentFolder.Identity.ToString()
@bill-long
bill-long / GenericDoAllPublicFoldersScript.ps1
Last active Jan 4, 2016
Generic script to iterate through public folders and do something via EWS. Use this as a basis for other scripts.
View GenericDoAllPublicFoldersScript.ps1
#################################################################################
# GenericDoAllPublicFoldersScript.ps1
#
# Generic script to do something to all public folders via EWS. Just change
# DoFolder to do what you want.
param([string]$FolderPath, [string]$HostName, [string]$UserName, [boolean]$Recurse)
#################################################################################
# Update the path below to match the actual path to the EWS managed API DLL.
@bill-long
bill-long / GenericDoAllMailboxFoldersScript.ps1
Last active Jul 5, 2018
Generic script to use Exchange Web Services Managed API do something to all items in all folders in a mailbox. Modify for your specific purpose.
View GenericDoAllMailboxFoldersScript.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 / DumpItemSubjects.ps1
Created Jan 28, 2014
Display the subjects of all items in one or more mailboxes.
View DumpItemSubjects.ps1
#########################################
# DumpItemSubjects.ps1
#
# Dumps the subjects of all items in the specified mailbox or mailboxes.
# You can specify one mailbox with -Mailbox, or specify multiple mailboxes
# by passing -InputFile and pointing to a file that contains a list of
# email addresses, one on each line.
#
# To capture the results, use Start-Transcript.
#
@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 / Sync-ReplState.ps1
Last active Mar 20, 2017
Sync ReplState table after running public folder repair request on Exchange 2010.
View Sync-ReplState.ps1
# Sync-ReplState.ps1
#
# After running a ReplState repair, it is often necessary to change
# the replica list on the affected folders by removing and re-adding
# the database in order to sync the data in the ReplState table with
# the Folders table.
#
# The purpose of this script is to scan the application log for the
# latest ReplState fix, get a list of the affected FIDs, then find
# those FIDs and modify the replica list, thus causing it to sync up.
View Find-UnlinkedPFProxies.ps1
$gcRootDSE = [ADSI]"GC://RootDSE"
$gcRoot = [ADSI]("GC://" + $gcRootDSE.dnsHostName)
"Using " + $gcRoot.Path
# Find all the PF proxies
"Finding all public folder directory objects..."
$pfProxyFinder = new-object System.DirectoryServices.DirectorySearcher($gcRoot, "(objectClass=publicFolder)")
$pfProxyFinder.PageSize = 100
$allPfProxies = $pfProxyFinder.FindAll()
"Found " + $allPfProxies.Count.ToString() + " public folder directory objects."
@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
You can’t perform that action at this time.