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 Children
No Data