[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

exchange management shell - storage groups

Posted on 2011-04-20
6
Medium Priority
?
312 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
0
Comment
Question by:happyexchange
  • 3
  • 3
6 Comments
 
LVL 8

Expert Comment

by:Mkris9
ID: 35433499
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"
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 35434314
also you have to columns with the name TargetDatabase
0
 

Accepted Solution

by:
happyexchange earned 0 total points
ID: 35436391
So something like this please see attachment

Then your script

Thank you
dat1.csv
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
LVL 8

Expert Comment

by:Mkris9
ID: 35443816
Yes - but best to use the target database in the format of "MBX01\SG1\DB1" rather than just the database name.
0
 

Author Closing Comment

by:happyexchange
ID: 36123134
All good
0
 

Author Comment

by:happyexchange
ID: 36096342
Delete
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

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

Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

873 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