Solved

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

Posted on 2014-07-26
5
877 Views
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 john_smith@mydomain.com -Target sipfed.online.lync.com -Credential $creds -HostedMigrationOverrideUrl https://admin0a.online.lync.com/HostedMigration/hostedmigrationservice.svc

Open in new window


thx in advance,

S.
0
Comment
Question by:siber1
[X]
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
5 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 40222034
$csv = get-content <path to csv>
foreach ($id in $csv) {
Move-CsUser -Identity $id -Target sipfed.online.lync.com -Credential $creds -HostedMigrationOverrideUrl https://admin0a.online.lync.com/HostedMigration/hostedmigrationservice.svc
}
0
 

Author Comment

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

Expert Comment

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

Author Closing Comment

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

Expert Comment

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

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: http://www.codetwo.com/excha…

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