Use multiple columns from a CSV in the one command.

Hello all,

I would like ot know if i can take 2 columns from 1 CSV file to create a parameter response in a powershell command.

For example, I have a CSV file containing Ad user data which is ot be used to create accounts.

We have givenname and surname fields.

In the context of this example I want to create form those 2 fields a fullname without the need for an additional column in the CSV file.

I have tried adding to the new-aduser command -name $_.givenname$_.surname however this didn't work.

Is it possible to combine 2 fields in this way or even to combine a string entered into the script with a column from the CSV? (such as a profile path like \\server01\users\$_.samaccountname)

Parents Reply
  • Hi nohandle,

    Your explanation was enlightening, thank you.

    I would like to know a little more. I have a two column csv file. The contents of the first column refers to a part of a folder name. The contents of the second column must be processed in the file names which are found in the folders by means of the first column. Do you think this is possible?

No Data