Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Make sure the report is in the $report variable. Then just copy and paste this into Exchange Management Shell.
- $report.Report.MailboxVerification | WHERE { $_.FolderIsMissing } | % {
- $path = $_.FolderSourcePath
- if (!($path.StartsWith("/IPM_SUBTREE"))) {
- continue
- }
- $path = $path.Substring(12).Replace("/", "\")
- $lastSlashIndex = $path.LastIndexOf("\")
- $folderName = $path.Substring($lastSlashIndex + 1)
- if ($lastSlashIndex -eq 0) {
- "Creating root folder: $folderName"
- New-PublicFolder $folderName
- } else {
- $parent = $path.Substring(0, $lastSlashIndex)
- "Creating new child folder in parent: $parent"
- "Child folder: $folderName"
- New-PublicFolder -Path $parent -Name $folderName
- }
- }
Add Comment
Please, Sign In to add comment