We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

exchange management shell - storage groups

happyexchange
on
Medium Priority
324 Views
Last Modified: 2012-06-21
Hi i have been using the script below to move the users (please see attachment) from one storage group to another

Import-Csv dat01.csv | foreach {move-mailbox $_.DisplayName -targetDatabase $_.targetdatabase}

Everytime i run this command in Exchange i keep getting this error message.  I know the ext is xls ut i have changed that to csv file on the exchange box.

Move-Mailbox : Cannot bind argument to parameter 'TargetDatabase' because it is
 null.
At line:1 char:76
+ Import-Csv Book1.csv | foreach {move-mailbox $_.DisplayName -targetDatabase <
<<<  $_.targetdatabase}
    + CategoryInfo          : InvalidData: (:) [Move-Mailbox], ParameterBindin
   gValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M
   icrosoft.Exchange.Management.RecipientTasks.MoveMailbox

Please help  Thank you
dat01.csv.xls
Comment
Watch Question

Commented:
Try this - Import-Csv dat01.csv | foreach {move-mailbox $_.DisplayName -targetDatabase "$_.targetdatabase"}

also please note that Database options normally needs to be in the format of  MailboxServer\StorageGroup\Database

for example   -TargetDatabase "MBX01\SG1\DB1"

Commented:
also you have to columns with the name TargetDatabase
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
Yes - but best to use the target database in the format of "MBX01\SG1\DB1" rather than just the database name.

Author

Commented:
All good

Author

Commented:
Delete
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.