Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Export-CSV but leave out first two lines

$
0
0

I am exporting data from AD, sAMAccount names to be exact, using Quest CMDlets.

I use Get-QADUser | Select SamAccountName | Export-CSV C:\file.csv

Everything works fine but in the output I get two rows at the top that I do not want.

The first is the type information which is easy enough by tacking -NoTypeInformation to the Export-CSV command

However, I also get SamAccountName as the first line when -NoTypeInformation is used. Is there a way to remove that line? Or conversely exclude it when using Get-Content to read the CSV in?

Thanks!


Viewing all articles
Browse latest Browse all 15028

Trending Articles