?
Solved

powershell output csv format

Posted on 2014-01-15
4
Medium Priority
?
968 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
[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
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 40

Accepted Solution

by:
footech earned 2000 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

Does Powershell have you tied up in knots?

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
A hard and fast method for reducing Active Directory Administrators members.
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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