Can someone provide a way to target an input CSV file on this powershell script

Posted on 2014-07-26
Last Modified: 2014-07-27
need assistance modifying this script to read from an input CSV file so that we can migrate users in bulk.

here is the code we are using for one user at a time:
Move-CsUser -Identity -Target -Credential $creds -HostedMigrationOverrideUrl

Open in new window

thx in advance,

Question by:siber1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 67

Accepted Solution

sirbounty earned 500 total points
ID: 40222034
$csv = get-content <path to csv>
foreach ($id in $csv) {
Move-CsUser -Identity $id -Target -Credential $creds -HostedMigrationOverrideUrl

Author Comment

ID: 40222118
thx ..  how can I have it not prompt for each user in the csv?
LVL 67

Expert Comment

ID: 40222383
How is your csv laid out?  It shouldn't prompt, but I'm not familiar with the move-csuser cmdlet

Author Closing Comment

ID: 40222474
thx. worked perfect, just needed to add -confirm:false$ to the end.
LVL 67

Expert Comment

ID: 40223135
Happy to help - thanks for the grade! :^)

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
A hard and fast method for reducing Active Directory Administrators members.
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
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to:…

717 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