Solved

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

Posted on 2014-07-26
5
822 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A brief introduction to what I consider to be the best editor for PowerShell.
Read this checklist to learn more about the 15 things you should never include in an email signature.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

809 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