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

x
?
Solved

EXCHANGE 2007 SCRIPTING

Posted on 2011-04-19
4
Medium Priority
?
447 Views
Last Modified: 2012-05-11
Hi im trying to move email users using this script.  The file is saved as dat01.csv and is saved in Exchange 2007 C:\Documents and Settings\admin.jamiec i have attached the csv file for which i am moving.

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

I keep getting this error message (pls see below) Any advice or help wpuld be appreciated. Thank you all

PS] C:\Documents and Settings\admin.jamiec>Import-Csv dat01.csv | foreach {move-mailbox $_.DisplayName -targetDatabase $_.targetdatabase}
Import-Csv : Cannot open file "C:\Documents and Settings\admin.jamiec\dat01.csv
".
At line:1 char:11
+ Import-Csv <<<<  dat01.csv | foreach {move-mailbox $_.DisplayName -targetDatabase $_.targetdatabase}
    + CategoryInfo          : OpenError: (:) [Import-Csv], FileNotFoundExcepti
   on
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.Im
   portCsvCommand
[PS] C:\Documents and Settings\admin.jamiec>

dat01.csv.xls
0
Comment
Question by:happyexchange
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
MegaNuk3 earned 2000 total points
ID: 35426526
Try:
Import-Csv "C:\Documents and Settings\admin.jamiec\dat01.csv" | foreach {move-mailbox $_.DisplayName -targetDatabase $_.targetdatabase}
0
 
LVL 31

Expert Comment

by:MegaNuk3
ID: 35426547
Hmmm,
Do a "DIR" to list the files in the directory. it looks as if you have .xls on the end of the CSV name, resave it as .csv
0
 
LVL 11

Expert Comment

by:Renato Montenegro Rustici
ID: 35427775
Also, make sure you are opeining a elevated (Run as Administrator) EMS powershell session.
0
 

Author Closing Comment

by:happyexchange
ID: 36096426
Thank you all
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
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