Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
248fb4a
Add new script that troubleshoot public folder deletion failures
hazemembaby Nov 8, 2022
c48ce54
Add md file for the script
hazemembaby Dec 19, 2022
8da73e1
modifications required done
hazemembaby Dec 26, 2022
6ee08fd
Add 2 new screenshots
hazemembaby Dec 26, 2022
89b3c70
modify one statement
hazemembaby Dec 27, 2022
fd7422e
Add new script that troubleshoot public folder deletion failures
hazemembaby Nov 8, 2022
f7757a1
Merge branch 'haembab-validatepfdumspterscript' of https://github.com…
hazemembaby Dec 27, 2022
ce5ed6e
Merge branch 'main' into haembab-validatepfdumspterscript
bill-long Jan 5, 2023
fa06618
modify mkdocs to update commit time
hazemembaby Jan 9, 2023
d646780
Merge branch 'haembab-validatepfdumspterscript' of https://github.com…
hazemembaby Jan 9, 2023
851dd04
modify mkdocs to update commit time 2
hazemembaby Jan 9, 2023
c6dfe21
Merge branch 'main' into haembab-validatepfdumspterscript
bill-long Jan 9, 2023
d645d3c
Pipe HashSet to Get-ChildItem so the collection is not treated as one…
bill-long Jan 9, 2023
cf13f02
Merge pull request #1420 from microsoft/bilong-codeformatter
dpaulson45 Jan 9, 2023
fa1d4a8
Merge branch 'main' into haembab-validatepfdumspterscript
dpaulson45 Jan 9, 2023
5336635
run codeformatter
hazemembaby Jan 9, 2023
08c9754
Use variable for target branch in pipeline and default to main for local
dpaulson45 Jan 9, 2023
b6fc5af
Remove AllFiles and use Branch to determine if optimize should be con…
dpaulson45 Jan 9, 2023
d08ac52
Merge pull request #1421 from microsoft/dpaul-FixBuildPipeline
dpaulson45 Jan 9, 2023
34cd83a
Merge branch 'main' into haembab-validatepfdumspterscript
dpaulson45 Jan 9, 2023
1219c0b
Merge pull request #1329 from hazemembaby/haembab-validatepfdumspters…
dpaulson45 Jan 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .build/CodeFormatter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ param(
[Switch]
$Save,

[Switch]
$AllFiles
[string]
$Branch
)

#Requires -Version 7
Expand All @@ -32,14 +32,14 @@ if (-not (Load-Module -Name EncodingAnalyzer)) {

$repoRoot = Get-Item "$PSScriptRoot\.."

$optimizeCodeFormatter = $AllFiles -eq $false
$optimizeCodeFormatter = [string]::IsNullOrEmpty($Branch) -eq $false
$filesFullPath = New-Object 'System.Collections.Generic.HashSet[string]'
# Get only the files that are changed in this PR
if ($optimizeCodeFormatter) {

Write-Verbose "Checking commits only"
# Get all the commits between origin/main and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/main..HEAD
# Get all the commits between origin/$Branch and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitlog | Select-String "^(\S+) (.*)$"

foreach ($commitMatch in $m) {
Expand Down Expand Up @@ -73,7 +73,7 @@ if ($optimizeCodeFormatter) {
}

if ($optimizeCodeFormatter) {
$filesToCheck = Get-ChildItem -Path $filesFullPath -Include "*.ps1", "*.psm1", "*.md"
$filesToCheck = $filesFullPath | Get-ChildItem -Include "*.ps1", "*.psm1", "*.md"
Write-Host "Files that we are looking at for code formatting:"
$filesToCheck.FullName | Write-Host
} else {
Expand Down
10 changes: 6 additions & 4 deletions .build/ValidateMerge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#>

[CmdletBinding()]
param ()
param (
[string]$Branch = "main"
)

$repoRoot = Get-Item "$PSScriptRoot\.."
$distFolder = Join-Path $repoRoot "dist"
Expand All @@ -38,8 +40,8 @@ $allowMergeFiles = @()
# Files we already checked. We only want to check each file once.
$filesAlreadyChecked = New-Object 'System.Collections.Generic.HashSet[string]'

# Get all the commits between origin/main and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/main..HEAD
# Get all the commits between origin/$Branch and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitlog | Select-String "^(\S+) (.*)$"

foreach ($commitMatch in $m) {
Expand Down Expand Up @@ -85,7 +87,7 @@ foreach ($commitMatch in $m) {
}

foreach ($affectedFile in $allAffectedFiles) {
$commitTimeOnMainString = git log origin/main -n 1 --format="%cd" --date=rfc -- $affectedFile
$commitTimeOnMainString = git log origin/$Branch -n 1 --format="%cd" --date=rfc -- $affectedFile
$commitTimeOnMain = $null
if (-not [string]::IsNullOrEmpty($commitTimeOnMainString)) {
$commitTimeOnMain = [DateTime]::Parse($commitTimeOnMainString).ToUniversalTime()
Expand Down
437 changes: 437 additions & 0 deletions PublicFolders/ValidateEXOPFDumpster.ps1

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions azure-pipeline-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ steps:

- pwsh: |
cd .\.build
.\CodeFormatter.ps1
.\CodeFormatter.ps1 -Branch $env:TargetBranchName
displayName: "Code Formatting Script"
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release'))
env:
TargetBranchName: $(System.PullRequest.TargetBranch)

- pwsh: |
cd .\.build
Expand All @@ -25,5 +27,7 @@ steps:

- pwsh: |
cd .\.build
.\ValidateMerge.ps1
.\ValidateMerge.ps1 -Branch $env:TargetBranchName
displayName: "Validate commit times"
env:
TargetBranchName: $(System.PullRequest.TargetBranch)
Binary file added docs/PublicFolders/PFDumps.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumps2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumps3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumps4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumps5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumps6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/PublicFolders/PFDumpswithoutparam.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/PublicFolders/ValidateEXOPFDumpster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ValidateEXOPFDumpster

Download the latest release: [ValidateEXOPFDumpster.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/ValidateEXOPFDumpster.ps1)

This script investigates public folders/items deletion operations failures & propose FIXes for mitigation.
The script is working to validate the below conditions over the affected public folder
Checks run:
-----------
1. Public folder size issue
a) Public folder content mailbox TotalDeletedItemSize value has exceeded its RecoverableItemsQuota value
b) Public folder size is full
2. User permissions are not synced between public folder mailboxes
3. Content Public folder mailbox across the public folder & its dumpster is different
4. EntryId & DumpsterEntryID values are not mapped properly on the public folder & its dumpster
5. Parent public folder dumpster is unhealthy
6. Dumpster folder
7. Dumpster folder has children
8. Mail-enabled public folder health if MEPFProxyGuid was null

## Syntax

```powershell
ValidateEXOPFDumpster.ps1
[-Pfolder <string[]>]
[-Affecteduser <string[]>]
[-ExportPath <string[]>]
```

## Output

The script will generate the public folder validation checks failures & proposed Fixes results on screen and will generate same results on ValidatePFDumpsterREPORT.txt file as well.
There are other files generated for either script logging purposes or sometimes for logs to be shared with Microsoft personnel in case issues encountered requires microsoft support team intervention.

File Name|Content|Use
-|-|-
ValidatePFDumpsterREPORT.txt|Information about any blockers found|The script will display what it found, and in many cases it will provide a mitigation to fix the problem
ValidatePFDumpsterCheckslogging.csv|Information about the reason of script failure to run|The file will display errors encountered on running the script and at which stage
PublicFolderInfo.xml|All required information about the affected public folder|This log file to be shared with Microsoft personnel

## Usage

Typically, the script should run with Pfolder identity parameter as illustrated below:

```powershell
.\ValidateEXOPFDumpster.ps1 -Pfolder \pf1
```

The script will prompt for affected public folder identity/EntryID if it wasn't provided using Pfolder parameter then it will prompt for global administrator username & password to connect to EXO by default it validates if the issue is specific to the Public folder "e.g. all users are affected"

![Picture of script intro](PFDumps.jpg)
![Picture of script intro without use Pfolder parameter](PFDumpswithoutparam.jpg)

If the issue happens only with a specific user on that case an affected user smtp address is required to be provided

![Picture of user specific issue type](PFDumps2.jpg)

In this example output, the script calls out two blockers.

It points out the below blockers:
Neither user nor Default user have sufficient permissions to delete items inside the public folder
Public folder size has exceeded Individual Public Folder ProhibitPostQuota value

![Picture of example](PFDumps3.jpg)

In this example output, the script calls out four blockers.

It points out the below issues:
Public folder & its dumpster doesn't have the same content public folder mailbox
Public folder EntryId & DumpsterEntryID values are not mapped properly
Public folder size has exceeded Organization DefaultPublicFolderProhibitPostQuota value
Public folder dumpster has 1 subfolder

The script created a log file containing all the required information "PublicFolderInfo.xml" to be shared with Microsoft personnel for the first two blockers & provided mitigation for the last two blockers and you can see same results under ValidatePFDumpsterREPORT.txt file.

![Picture of example](PFDumps4.jpg)
![Picture of Log files](PFDumps5.jpg)
![Picture of Log file to Microsoft personnel](PFDumps6.jpg)

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ nav:
- PublicFolders:
- SourceSideValidations: PublicFolders/SourceSideValidations.md
- ValidateMailEnabledPublicFolders: PublicFolders/ValidateMailEnabledPublicFolders.md
- ValidateEXOPFDumpster: PublicFolders/ValidateEXOPFDumpster.md
- Retention:
- Get-MRMDetails: Retention/Get-MRMDetails.md
- Search:
Expand Down