Powershell Get-QADComputer question

I am trying to get a list of computers from Active Directory using the Quest Active Directory cmdlets.  I am using "            
Get-QADComputer -SearchRoot $SearchOU -WarningAction Stop | Select-Object name| Sort-Object name"
The problem is that it is returning the name as '@{name=mypcname}'.  How do I need to change it to return just the name as 'mypcname'?
Thanks in advance.
Art W.
Who is Participating?
SubsunConnect With a Mentor Commented:
If you are trying to get only the computer name as output then, you can try..

Get-QADComputer -SearchRoot $SearchOU -WarningAction Stop | Sort-Object name | %{$_.name}

Open in new window

Get-QADComputer -SearchRoot $SearchOU -WarningAction Stop | Sort-Object name | Select -ExpandProperty Name 

Open in new window

QlemoBatchelor and DeveloperCommented:
Sure that code snippet is generating the hash table result? When I try, I get proper objects with a name property ...
ajwellmanAuthor Commented:
Thanks so much.
That worked great.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.