Solved

Can the "Database is mandatory for user mailbox" be resolved using PowerShell

Posted on 2009-05-07
2
3,376 Views
Last Modified: 2012-05-06
Hello Experts,

Here is the issue Im encountering.  Im in the process of testing an Exchange migration from Exchange 2000 to Exchange 2007.  Ive successfully restored my AD into a lab environment and verified AD is working correctly.  Ive semi-successfully restored Exchange 2000 into the lab environment.  What has happened with the Exchange 2000 restore is approximately 200 of 1000 mailboxes restored correctly (they show up in the Exchange System Manager) and work perfectly in lab.  When I open AD Users and Computers on my lab Exchange 2000 server and access one of the users whose mailbox is among the 200 mailboxes showing up in Exchange 2000 System Manager and click on the Exchange General tab, I see the following information:
Mailbox Store:
Exchg2000/First Storage Group/Mailbox Store (Exchg2000)

Note: Exchg2000 is the name of the Exchange 2000 server

 When I access one of the users whose mailbox is not among one of the 200 mailboxes showing up in the Exchange 2000 System Manager and click on the Exchange General tab, I see the following information:
Home Server
Yavapai/Exchg2000/Exchg2000

Note:  Yavapai is the name of the Exchange organization
Note: Exchg2000 is the name of the Exchange 2000 server

I have introduced Exchange 2007 into the lab and it is coexisting with Exchange 2000.  When I open the Exchange 2007 Management Console à Recipient Configuration à Mailbox, I see all 1000 mailboxes.  If I try to move one of the 200 mailboxes that I can see in the Exchange 2000 System Manager, the move is successful (moves can be don via the EMC or the Exchange shell).  If I try moving one of the 800 mailboxes that did not show up in the Exchange 2000 System Manager, then I get an error stating:  Database is mandatory on user mailbox.

To correct this problem, I do the following:
1.      Access AD Users and Computers on the Exchange 2000 server.
2.      Right-click on a user account whose mailbox is not among the 2000 listed in the Exchange 2000 System Manager
3.      Select the Exchange Tasks
4.      Select the Remove Exchange Attributes option
5.      Click <Finish>
6.       Right-click on a user account whose mailbox is not among the 2000 listed in the Exchange 2000 System Manager
7.      Select the Exchange Tasks
8.      Select the Create Mailbox option
9.      Verify the server information is as follows:
Yavapai/Exchg2000/Exchg2000

10.      Verify the mailbox store information is as follows:
First Storage Group/Mailbox Store (Exchg2000)

11.      Click Finish

Once this has been done, the mailbox can be moved to Exchange 2007.

Here is my question, is there a way to use powershell to script this process?

Regards,
Nick
0
Comment
Question by:ndalmolin_13
2 Comments
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
Comment Utility

Hey Nick,

Still after this one?

It's far easier using VbScript. Using PowerShell is possible, but you need to create a wrapper for CDOEXM (COM Interoperability) before it can be used. That alone isn't much fun, actually using it afterwards is worse.

If you were to stick with VbScript it should be possible to do something like this psuedo-code:

Get a List of users with no mailbox database set (is this the problem? If so an LDAP filter can be used to find them)
For Each User in the Domain
  Execute the MailDisable method on the user
  Set Info
  Execute the MailEnable method on the user (pointing it at the database in question)
  Set Info
Loop

Chris
0
 
LVL 1

Author Closing Comment

by:ndalmolin_13
Comment Utility
Chris,
Thanks for the suggestion.  I had one of our VB guys look at your post and the issue and we got a VB script to work.

Nick
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
how to add IIS SMTP to handle application/Scanner relays into office 365.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now