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
<# | |
.SYNOPSIS | |
Searches the forest for a SID match in objectSid, sidHistory, or msExchMasterAccountSid. | |
.EXAMPLE | |
PS C:\> .\Find-Sid.ps1 -Sid "S-1-5-21-408950988-2208783158-1246939005-2158" | |
Shows all objects matching the specified SID. | |
#> | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] |
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
$prefix = "LAB1" | |
New-LabDefinition -Name $prefix -DefaultVirtualizationEngine HyperV -ReferenceDiskSizeInGB 100 -VMPath "E:\VMs" | |
$e15role = Get-LabPostInstallationActivity -CustomRole Exchange2013 -Properties @{ OrganizationName = 'First Organization' } | |
$e16role = Get-LabPostInstallationActivity -CustomRole Exchange2016 -Properties @{ OrganizationName = 'First Organization' } | |
$e19role = Get-LabPostInstallationActivity -CustomRole Exchange2019 -Properties @{ OrganizationName = 'First Organization' } | |
Add-LabMachineDefinition -Name "$($prefix)DC1" -OperatingSystem 'Windows Server 2016 Standard (Desktop Experience)' -MinMemory 2GB -Memory 2GB -MaxMemory 8GB -Processors 4 -DomainName "$($prefix.ToLower()).local" -Roles RootDC |
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
<# | |
.SYNOPSIS | |
Finds a mailbox item using a partial EntryId and a message class. | |
.DESCRIPTION | |
Corrupted items may have only a few properties and an EntryId that | |
cannot be opened in MFCMapi. This often surfaces as a reminder that | |
repeatedly shows up while the appointment for that reminder cannot | |
be found. | |
When other approaches fail, you can find the corrupted |
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
# Dump-ScanningProcessOnTimeout | |
################################### | |
# | |
# Change these paths as needed. | |
# | |
$dumpFolder = 'C:\data' | |
$procdumpBinary = 'C:\ProgramData\chocolatey\lib\sysinternals\tools\procdump.exe' |
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
# Attach-OnProcessStart | |
$ProcessName = "notepad.exe" | |
$ExceptionFilter = "ScanQueueTimeoutException" | |
Register-CimIndicationEvent -ClassName Win32_ProcessStartTrace -SourceIdentifier "ProcessStarted" | |
while ($true) { | |
$e = @(Get-Event) | |
if ($e.Count -lt 1) { |
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
param($Database, $MailboxNumberToWatch) | |
$startingNumber = 0 | |
$currentNumber = 0 | |
$results = .\Count-PhysicalIndexes.ps1 -Database $Database -SaveResults $true | |
$startingNumber = ($results | Where-Object { $_.MailboxNumber -eq $MailboxNumberToWatch }).IndexCount | |
$currentNumber = $startingNumber |
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
param($Database, $SaveResults) | |
. $exscripts\ManagedStoreDiagnosticFunctions.ps1 | |
if ($null -eq (Get-Command Get-StoreQuery -ErrorAction SilentlyContinue)) { | |
Write-Error "ManagedStoreDiagnosticFunctions not loaded." | |
return | |
} | |
$results = @() |
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
# Reports the number of indexes per folder for a given mailbox. | |
# Mailbox can be specified by display name or mailbox number. | |
[CmdletBinding()] | |
param ( | |
[Parameter(Position = 0, Mandatory = $true)] | |
[string] | |
$Database, | |
[Parameter()] |
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
# Reports the number of indexes per folder for a given mailbox. | |
# Mailbox can be specified by display name or mailbox number. | |
[CmdletBinding()] | |
param ( | |
[Parameter(Position=0, Mandatory=$true)] | |
[string] | |
$Database, | |
[Parameter()] |
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
Get-MailboxFolderStatistics administrator -FolderScope NonIpmRoot | Select Identity,@{Label="EntryId"; Expression={ -join ([Convert]::FromBase64String($_.FolderId) | % { $_.ToString("X2") }) }} |