How to put in condition to look up into a list of OneDrive URL in csv

JT 61 Reputation points
2021-02-09T08:29:15.863+00:00

65684-condition.jpg

65685-sourcecode.txt

I m new to the powerShell. I need help for below

  1. I have the code to export the all the OneDrive files structures in user's OneDrive which is in SharePoint.
  2. The code is target by URL , eg: $srcUrl = "https://XXX.sharepoint.com/personal/XXXX_com"
  3. So how to include a condition in this code to lookup into a csv files and process more than one URL ?
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,917 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerry Xu-MSFT 7,956 Reputation points
    2021-02-10T02:56:33.507+00:00

    Hi, @JT ,

    If you have all the user name, password, and the OneDrive URL in your csv, you can directly import the csv file with the cmdlet import-csv. It will create a table-like custom objects from the items in a comma-separated value (CSV) file.

    Example is like :

    $users=import-csv "C:\Users\user1\Downloads\users.csv"  
    

    With this the table is stored in the object $users. You can get the required entry with index and property name like $users[1]."Proxy addresses". And of course you can use foreach to use all the entries.

    Something like Foreach($user in $users ){write-host $user."Proxy addresses"}
    66088-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.