We help IT Professionals succeed at work.
Get Started

Importing a CSV with First + Last Name and performing action

Last Modified: 2012-05-12
I'm trying to figure out how to, in PowerShell/Exchange PowerShell/Quest Powershell how to import a CSV that contains one column header is "user" and in the column is a list of employee First name and Last name, for example:
John Smith

Open in new window

I do:
$people = Import-Csv .\escalationlist.csv | %{$_.User}

Open in new window

get-qaduser $people

Open in new window

But I get:

Get-QADUser : Cannot convert 'System.Object[]' to the type 'Quest.ActiveRoles.ArsPowerShellSnapIn.Data.IdentityParamete
r' required by parameter 'Identity'. Specified method is not supported.
At line:1 char:12
+ Get-QADUser <<<<  $people
    + CategoryInfo          : InvalidArgument: (:) [Get-QADUser], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.GetUserCm

If I could put quotes around $people then one would think it would work

Is there a way to lookup the AD username/account name based off this display name?
Watch Question
Professional Services Engineer
This problem has been solved!
Unlock 4 Answers and 8 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE