This file contains 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
################################################################################# | |
# | |
# 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 |
This file contains 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
# 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() |
This file contains 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
################################################################################# | |
# 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. |
This file contains 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
######################################### | |
# 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. | |
# |
This file contains 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
######################################### | |
# 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. | |
# |
This file contains 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
# 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 | |
# |
This file contains 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
# 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. |
This file contains 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
$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." |
This file contains 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
# 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) | |
{ |
This file contains 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
# 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 |
OlderNewer