Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Export-csv

$
0
0

Hello all, I have been searching on this for a few hours but cannot find a fix. All I want to do is export the findings of these OUs.

Get-ADComputer -Filter * -SearchBase "OU=Laptops,OU=ITS,OU=COM,DC=OURS,DC=LOC,DC=OO,DC=us" | Select-Object Name 
Get-ADComputer -Filter * -SearchBase "OU=Desktops,OU=ITS,OU=COM,DC=OURS,DC=LOC,DC=OO,DC=us" | Select-Object Name
Get-ADComputer -Filter * -SearchBase "OU=Desktops,OU=ITS,OU=COM,DC=OURS,DC=LOC,DC=OO,DC=us" | Select-Object Name

Export-CSV c:\users\xxxxxxx\desktop\its.csv

When I run this it returns

cmdlet Export-Csv at command pipeline position 1
Supply values for the following parameters:
InputObject: 

If I do it like this it works but need to export it to separate .cvs

Get-ADComputer -Filter * -SearchBase "OU=Desktops,OU=ITS,OU=COM,DC=OURS,DC=LOC,DC=OO,DC=us" | Select-Object Name | Export-CSV c:\users\xxxxxxx\desktop\its.csv

What am i missing?

Thanks, Joe


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>