[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Powershell question

Posted on 2011-03-24
2
Medium Priority
?
363 Views
Last Modified: 2012-05-11
hello, need assistance with the last part of this script.
basically, trying to send the results of this script to a csv:

get-qaduser -searchroot "OU=accounts,DC=domain,DC=com" -ldapfilter '(sAMAccountName)' | Format-List name,description

would like to | these results to a .csv.
i've tried adding this at the end:  | export-csv results.csv

but doesnt work.

thanks in advance,

S.
0
Comment
Question by:siber1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
wls3 earned 2000 total points
ID: 35210201
As noted by Brandon in this post:

http://www.eggheadcafe.com/software/aspnet/33415041/exportcsv-issues.aspx

you should use the select instead of format cmdlet before piping to the export-csv cmdlet.  You might want to do some dry runs on the select versus the format cmdlets with gm to see what kind of differences there are in the underlying objects.

To answer your question, try this:

get-qaduser -searchroot "OU=accounts,DC=domain,DC=com" -ldapfilter '(sAMAccountName)' | Select name,description | export-csv results.csv

Open in new window

0
 

Author Comment

by:siber1
ID: 35210362
that did it! thanks much
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Let's recap what we learned from yesterday's Skyport Systems webinar.
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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 …
Suggested Courses

656 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