We help IT Professionals succeed at work.
Get Started

Importing a CSV with First + Last Name and performing action

641 Views
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:
User
John Smith

Open in new window


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

Open in new window

then
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
   dlet


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?
Comment
Watch Question
Professional Services Engineer
Commented:
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