Solved

powershell output csv format

Posted on 2014-01-15
4
895 Views
Last Modified: 2014-01-15
Hi guys

I can use
Get-Mailbox -resultsize unlimited | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | ft identity, lastsuccesssync, Devicetype
to get them in powershell. or output it to a csv file.

but the format is not what i want. the csv only has one column.

does any one know a way to output the result into a csv file with three columns?

thanks a lot.

SYH
0
Comment
Question by:BLarry9
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 39784083
Yes all you need to do is the following...

Get-Mailbox -resultsize unlimited | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | select identity, lastsuccesssync, DeviceType | out-file c:\filename.csv

Open in new window


Will.
0
 

Author Comment

by:BLarry9
ID: 39784090
nope, still in one column.
0
 
LVL 39

Accepted Solution

by:
footech earned 500 total points
ID: 39784101
Use the Export-CSV cmdlet.
Get-Mailbox -resultsize unlimited | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | Select identity, lastsuccesssync, Devicetype | Export-CSV somefile.csv -notype

Open in new window

0
 

Author Comment

by:BLarry9
ID: 39784116
super. thanks.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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 to another domain controller. Log onto the new domain controller with a user account t…

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now