Skip to content

Instantly share code, notes, and snippets.

@notesbytom
Created November 14, 2017 22:15
Show Gist options
  • Save notesbytom/fdf7a57711ab5cd27b9ac017496d5f58 to your computer and use it in GitHub Desktop.
Save notesbytom/fdf7a57711ab5cd27b9ac017496d5f58 to your computer and use it in GitHub Desktop.
Clear Old Public Folder Database Settings on Mailbox Databases in Exchange 2013+
import-module activedirectory
# Substitute correct values in place of * and com below.
cd "AD:\CN=Databases,CN=Exchange Administrative Group (*),CN=Administrative Groups,CN=*,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=*,DC=com"
get-item * -Properties msExchHomePublicMDB | `
foreach {
# Show name of mailbox database
$_.Name;
if ($_.msExchHomePublicMDB -eq $null) {
"NULL PF DB"
} else {
# Show name of public folder database (legacy)
$_.msExchHomePublicMDB;
# Clear the legacy public folder database setting on mailbox db
set-adobject $_ -Clear "msExchHomePublicMDB" -verbose
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment