[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I get powershell to return data without any formating

Posted on 2009-04-16
4
Medium Priority
?
272 Views
Last Modified: 2012-05-06
Hello Experts,

I'm new to PowerShell.  I'm using PowerShell 1.0 and have downloaded the Active Directory commandlets from Quest.com.  I want to get a list of users in a certain department.  I use the following from the Quest shell.

get-qaduser -department GIS | select-object Name

This returns the information in a nice formatted manner.  There is a column with a column header of Name.  I would like the data to be returned without the preconfigured formating and without the column header.  How would I do that?
0
Comment
Question by:ndalmolin_13
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:ndalmolin_13
ID: 24157510
If I run the following command:    (get-service spooler).status
the only thing returned is: running.

 I have tried (get-qaduser -department GIS).name   and I get nothing.  Any help would be appreciated.

Regards,
Nick
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 2000 total points
ID: 24157520

Get-QADUser -Department GIS | %{ $_.Name }

% is ForEach-Object, a loop through every returned item. $_.Name just echoes the Name property (of the object passed in the pipeline). That gives you a simple, unformatted, list.

Chris
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24157530

> I have tried (get-qaduser -department GIS).name

That only works when there's only a single object in the list. You have more than one so it failed, that's where the loop above comes in.

Chris
0
 
LVL 1

Author Closing Comment

by:ndalmolin_13
ID: 31570974
This is exactly what I needed.  Thanks for your quick response.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month18 days, 8 hours left to enroll

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question