• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Validating and Initializing a Message Store using Shell scripting

Hi,
I'm using Powershell to create new mailboxes and import existing pst's in it.  The mailbox creates just fine but the import fails.  It gives this error: " Error occurred in the step: Approving object. An unknown error has occurred., error code: -2147221219".  I have enough rights because I run the script as exchange admin.  If I setup outlook and look in the mailbox it's empty.  Afterwards, when I do the import again, it works fine.
My guess is that, when creating the mailbox the first time, the mailbox is empty, no mails but also no default mailfolders.  When you open the mailbox with outlook the first time, these folders are created.  So I need a shell script to 'initialise' a mailbox the first so the right folder structure is created.  Anybody knows how to do that?
0
boein
Asked:
boein
  • 4
  • 4
1 Solution
 
SurajCommented:
Check if any inactive Domain controller showing up in AD Sites & Services ...

-x
0
 
boeinAuthor Commented:
Hi,
no only 2 active severs showing up.  Both are Global Catalog, can that be the problem?
0
 
SurajCommented:
Try to import the PST using Outlook, in this case it was having a Password
Protection.Put the passowrd and try importing it.
The passwod Protected PST's will not get Imported using inmport-mailbox command.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
SurajCommented:
The above error can also occur on the machine from which 'Export-mailbox' is executed
whn the 'Default Gateway' is not populated on the NIC's properties. do you have the default gateway Set??
Let me know the results..
-x
0
 
boeinAuthor Commented:
Hi,

Checked the network config, all seems to be OK with default gateway.  Also I'm always importing from the same computer, all pst's are on a network share.  The pst is not password protected, it's a test-pst with only a few mails in it.  I still believe it's because a new created mailbox misses the "standard" folders like "inbox","sent items","deleted items"...  Because I can import if I open the mailbox once.  
what do you think?
regards
Boein
0
 
SurajCommented:
You got a point there.. Give me some time.. i will research on this and get back to you...
thanks
0
 
boeinAuthor Commented:
Any news on the research?
0
 
boeinAuthor Commented:
Running outlook with only 1 profile configured that has full-access to all the mailboxes seems to help.
So it looks like the outlook client has to be open while running the import-mailbox cmd, dunno why but it works.

0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now