Solved

powershell output csv format

Posted on 2014-01-15
4
810 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Set OWA language and time zone in Exchange for individuals, all users or per database.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

706 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

17 Experts available now in Live!

Get 1:1 Help Now