• Home
  • Topics
    • Office 365
    • Teams
    • SharePoint Online
    • Exchange 2019
    • Exchange 2016
    • Exchange 2013
    • Hybrid
    • Certificates
    • PowerShell
    • Migration
    • Security
    • Azure
  • Blog
  • Podcast
  • Webinars
  • Books
  • About
  • Videos
    • Interview Videos
    • How To Guide Videos
  • Subscribe
    • Facebook
    • Twitter
    • RSS
    • YouTube

Practical 365

You are here: Home / Exchange Server / PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases

PowerShell: Configuring Settings on Multiple Exchange Mailbox Databases

April 27, 2011 by Paul Cunningham Leave a Comment

One of the strengths of using PowerShell for Exchange Server administration is the ability to perform changes to multiple objects simultaneously. In this article I will demonstrate an example of this by showing you how to update a setting on multiple Exchange Server mailbox databases at once.

In this example the public folder database associated with the mailbox databases needs to be configured. There is already one mailbox database with the correct public folder setting and we want to apply the same setting to all of the other mailbox databases on the server.

Doing this manually, one at a time would be tedious.  But thanks to the Exchange Management Shell we can do it very quickly.

First, read the desired public folder setting from the first mailbox database into a variable.

1
[PS] C:\>$pfdb = (Get-mailboxdatabase EX2007MB1EX2007MB1_DB1).publicfolderdatabase


Now we can inspect the variable to see the result of that first step.

1
2
3
4
5
6
7
8
9
10
11
12
13
[PS] C:\>$pfdb
 
Rdn               : CN=EX2007PF1_DB1
Parent            : EX2007PF1EX2007PF1_SG1
Depth             : 12
DistinguishedName : CN=EX2007PF1_DB1,CN=EX2007PF1_SG1,CN=InformationStore,C
                    N=EX2007PF1,CN=Servers,CN=Exchange Administrative Group (
                    FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Corp,CN=M
                    icrosoft Exchange,CN=Services,CN=Configuration,DC=corp,
                    DC=org
DomainId          : corp.org
ObjectGuid        : e898f054-85f2-4486-9d35-654a16083348
Name              : EX2007PF1_DB1


Next, we apply that public folder setting to all of the mailbox databases on the server with this single command line.

1
[PS] C:\>Get-MailboxDatabase -server EX2007MB1 | Set-MailboxDatabase -PublicFolderDatabase $pfdb


Now we can confirm that the change has occurred.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[PS] C:\>Get-MailboxDatabase -server EX2007MB1 | ft name,publicfolderdatabase
 
Name                                    PublicFolderDatabase
----                                    --------------------
EX2007MB1_DB1                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB2                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB3                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB4                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB5                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB6                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB7                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB8                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB9                         EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB10                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB11                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB12                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB13                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB14                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB15                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB16                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB17                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB18                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB19                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB20                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB21                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB22                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB23                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB24                        EX2007PF1EX2007PF1_SG1EX2007PF...
EX2007MB1_DB25                        EX2007PF1EX2007PF1_SG1EX2007PF...


As you can see the Exchange Management Shell lets us make bulk changes with ease.

Exchange Server EMS, Exchange 2007, Exchange 2010, Exchange Management Shell, PowerShell, Public Folders, Scripting

Leave a Reply Cancel reply

You have to agree to the comment policy.

Recent Articles

  • Changes in Microsoft 365 Apps Channels and Why You Should Care
  • A New Tool to Manage Exchange-related Attributes Without Exchange Server
  • Microsoft Launches Group Ownership Governance Policy
  • Making the Case for Identity Governance in Azure Active Directory
  • Prepare an Office 365 migration plan assessment using PowerShell

Copyright © 2022 Quadrotech Solutions AG · Disclosure · Privacy Policy
Alpenstrasse 15, 6304 Zug, Switzerland