Solved

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

Posted on 2009-05-07
2
3,383 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
ID: 24357733

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
ID: 31579129
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

860 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