Exchange Server Share

August 19, 2008

How To: Move System Attendant Mailbox – Exchange 2003

Filed under: Exchange, Exchange 2003 — Amit Tank @ 9:11 am
Tags: , ,

This is commonly asked question, “I want to delete my first mailbox database but System Attendant mailbox is staying in it so how to move System Attendant Mailbox from one mailbox database to another on the same server?”

I think procedure is known to move SA mailbox but not documented anywhere so I thought let’s document it with an example.

 

Scenario in our example: I have an Exchange 2003 server ESS-EXCH301 with two databases ESS301SG1DB1 & ESS301SG1DB2 in ESS301SG1 storage group and this server is in ESS-Test.com domain. I want to move SA mailbox from ESS301SG1DB1 to ESS301SG1DB2 database.

By default System Attendant mailbox is created in the first database configured on the server during installation in our case it is renamed to ESS301SG1DB1.

When you try to move the System Attendant mailbox with exchange task then you don’t see any task available.

image

When you try to delete first database which contain SA mailbox then you get following warning.

image

Procedure To Move SA: 

  • Make sure that all the user mailboxes are moved to other database ESS301SG1DB2.

image

  • Open ADSIEdit.msc and change the homeMDB attribute of the Microsoft System Attendant object to point new database.

Path of SA object: Configuration context -> CN=Services -> CN=Microsoft Exchange -> CN=(Your Exchange Org Name) -> CN=Administrative Groups -> CN=(Your Admin Group Name) -> CN=Servers -> CN=Microsoft System Attendant

image

Current homeMDB attribute:

CN=ESS301SG1DB1,CN=ESS301SG1,CN=InformationStore,CN=ESS-EXCH301,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=Exchange Share,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=ESS-Test,DC=com

New homeMDB attribute:

CN=ESS301SG1DB2,CN=ESS301SG1,CN=InformationStore,CN=ESS-EXCH301,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=Exchange Share,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=ESS-Test,DC=com

New homeMDB attribute is the distinguishedName value of your new database. You can get from below location.

ADSIEdit.msc -> Configuration context -> CN=Services -> CN=Microsoft Exchange -> CN=(Your Exchange Org Name) -> CN=Administrative Groups -> CN=(Your Admin Group Name) -> CN=Servers -> CN=(Your Server Name) -> CN=InformationStore -> Click on CN=(Storage Group Name) -> In Right Pane you can see list of all mailbox database -> Right click on New Database & Click Properties -> Double Click on distinguishedName and copy the value of it.

image

Note: Make sure that you enter correct DN of mailbox database into homeMDB attribute otherwise you may get below error.

Error message when you try to move a user’s mailbox to another server in Exchange 2000 Server or Exchange Server 2003: “Error: Connecting to destination server”

  • Restart all Exchange services.
  • Run the Mailbox Cleanup Agent on your original database ESS301SG1DB1 which will mark your System Attendant mailbox as a disconnected.

image

  • Right click on System Attendant mailbox and purge it (delete it permanently).

image

Note: You can not move System Attendant Mailbox back to this physical database in future, if you want to move it back then you need to delete the database and need to recreate new edb & stm file then only you can move it back.

  • Refresh the mailboxes on new database ESS301SG1DB2 and you can see System Attendant mailbox on it. If still not able to see new SA mailbox then you need to run the mailbox Cleanup Agent on the new database.

image

  • However, still you can not see new SA mailbox in new DB then you need to send a mail to System Attendant mailbox from your mailbox with delivery receipt and make sure that you receive delivery receipt back which creates SA mailbox in new database.

Email address of System Attendant is SERVERNAME-SA@DomainName.com

image

image

Well, that’s all. But make sure that there isn’t any error in your event logs if so then you need to address it accordingly.

References:

Overview of Exchange 2000/2003 Mailboxes: Overview of Exchange 2000 Server and Exchange Server 2003 Special Mailboxes

Some of the circumstances under which the system attendant mailbox can and cannot be generated in a database explained here: Issues with the System Attendant Mailbox When Moving an Exchange Mailbox Database

August 17, 2008

Exchange 2007 & Display Name Format

Here is another good question asked on TechNet forum about “Exchange 2007 & Display Name” – How to change the display name format from <First Name> <Initial> <Last Name> to <Last Name>, <First Name> <Initial> in Exchange 2007 user/mailbox creation process?”

 

Let’s start with some Exchange 2003 background…

Exchange 2003:

We use Active Directory Users & Computers (ADU&C) to create users/mailboxes. By default name & display name formats are “<First Name> <Initial>. <Last Name>” in ADU&C creation process but it can be changed to “<Last Name>, <First Name> <Initial>” by setting createDialog attribute of the user-Display object under CN=DisplaySpecifiers, CN=409 object (409 represent U.S. English language) in the configuration naming context by using ADSIEDIT.msc to value %<sn>, %<givenname> %<initials>.

Procedure is explained here: How to change display names of Active Directory users

image

After setting createDialog value while creating user/mailbox when we enter First name, Last name & Initials fields, it takes Full name in <Last Name>, <First Name> <Initial> format automatically (we don’t have to enter it manually) .

image

Display name sets same as Full Name automatically when you create any users.

image

 

Now, let’s talk about Exchange 2007.

Exchange 2007:

When we create mailbox for new user in Exchange Server 2007 Exchange Management Console, it does not recognize the value of the createDialog attribute of user-Display object of a displaySpecifier class and stays with default format <FN> <I> <LN>.

Dave explained here that it is by design and limitation of EMC. Workaround is to create users with ADU&C MMC and later create mailboxes for those users with EMC.

Changing the display name of active directory users.

 

Now, some questions come here…

1. How do I change Name & Display Name of existing users, if I already created some of the users with EMC?

Here is an example where users are already created in <FN> <I>. <LN> format with Exchange 2007 – EMC.

image

You don’t have to worry about changing all those one by one since PowerShell is your friend. Here is the script which changes the name & display name format of all mailbox users to <LN>, <FN> <I>.

To run PowerShell scripts you need to change Execution Policy in EMS.

Go to Exchange Management Shell and execute below command to set execution policy so you can run the ps1 scripts.

Set-ExecutionPolicy RemoteSigned

image

Now, save below script in C:\Scripts\Pre-Users.ps1 file.

=====================Pre-User.ps1=====================

# Pre-Users.ps1 - Change the name & display name of existing users.
# Created by - Amit Tank
$Users = Get-User -ResultSize unlimited | where {$_.RecipientTypeDetails -eq "UserMailbox"}
ForEach ($User in $Users)
{
$DName = $User.LastName + ", " + $User.FirstName + " " + $user.Initials
$DName = $Dname.Trim()
Set-User $User -Name $DName -DisplayName $DName
Get-User $User | FT Name, DisplayName
$DName = $Null
}

image

Go to Exchange Management Shell and execute the script with ./Pre-Users.ps1 command.

image 

Well, all Name & Display Name are set in <LN>, <FN> <I> format.

Depending on the format of Room/Shared mailboxes in your organization you can change name & display name of those also. You need to change below line in the script based on your requirement.

$Users = Get-User -ResultSize unlimited | where {$_.RecipientTypeDetails
-eq “RoomMailbox”}

$Users = Get-User -ResultSize unlimited | where {$_.RecipientTypeDetails
-eq “SharedMailbox”}

2. What should I do if I want to create users/mailboxes with EMC/EMS with  correct format?

EMC:

Make a practice or document it in user/mailbox creation process manual of your organization that “Name” filed should be given in <LN>, <FN> <I> format manually (EMC sets Display Name same as a Name).

image

image

EMS:

Same as EMC, Make a practice or document it in user/mailbox creation process manual of your organization that “Name” & “Display Name” should be given in <LN>, <FN> <I> format by specifying -Name & -DisplayName switches.

New-Mailbox -Alias HWood -Database “First Storage Group\Mailbox Database” -Name “Wood, Haley V” -OrganizationalUnit “ESS-Test.com/Users” -FirstName Haley -LastName Wood -Initial V -DisplayName “Wood, Haley V” -UserPrincipalName HWood@ESS-Test.com

image

3. How do I make sure that new users/mailboxes will be created with correct format?

Well, you can schedule a PowerShell script which runs every night and verifies the mailboxes which are created in last 24 hours and correct the format if it is not in correct one.

Create below two files in C:\Scripts folder on your Exchange server.

=============UserName.CMD=============

Powershell -command "& {C:\Scripts\UserName.ps1 }"

 

image

=====================UserName.PS1=====================

# UserName.ps1 - Change the name & display name of users which are created in last 24 hours.
# Created by - Amit Tank
 
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
 
$Users = Get-User -ResultSize Unlimited | where {($_.WhenCreated -gt (get-date).adddays(-1)) -and ($_.RecipientTypeDetails -eq "UserMailbox")}
ForEach ($User in $Users)
{
$DName = $User.LastName + ", " + $User.FirstName + " " + $user.Initials
$DName = $Dname.Trim()
Set-User $User -Name $DName -DisplayName $DName
Get-User $User | FT Name, DisplayName
$DName = $Null
}

image

Now create a Task in windows task scheduler to run this script at 12:00AM midnight.

image

All set, now this automation will take care about newly created mailboxes every night.

eg. I have below user created with wrong name & display name format which has taken care by this midnight scheduled script.

image

image

You may also add a code in PowerShell script to trigger a mail to administrator for the confirmation that script has run and changed the display names successfully.

Blog at WordPress.com.