Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Publicfolderstatistics result is not displayed correctly in CSV.

Posted on 2016-08-19
6
Medium Priority
?
60 Views
Last Modified: 2016-08-22
I am running a get-publicfolderstatistics in Exchange Management Shell to list a couple of properties of each Public Folder.  The result is returned as expected.  

I then run the same command again and pipe the result to a CSV file, I see the result differently - please see the attached.  
Public Folder StatisticsPlease advise how to fix this.  

Thanks,
0
Comment
Question by:nav2567
[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
  • 3
  • 2
6 Comments
 
LVL 71

Expert Comment

by:Qlemo
ID: 41763575
You did several typical beginner's mistakes:
  • Piping format-* cmdlet output to a file. That does not work - that formatting is intended only for display in the console screen. You can make it work to create a plain text output, but that is not the what you should do.
  • Considering a CSV file to be an Excel file. That's wrong. CSV is a structured text file containing multi-column data with delimiters. Excel uses binary formats.
  • Posting a screenshot as attachment, and not using the "embed" feature, so we do not see it unless we download. I've changed that already (being a Topic Advisor, I'm able to edit questions).
First attempt usually is to really export to CSV, but on screen, to see what you would get:
<# your code generating output #> | Select <# list of columns you want to keep #> | ConvertTo-CSV -NoType

Open in new window

You can leave out the Select if you do not want to modify which columns to see.
If that works, you just replace ConvertTo-CSV -NoType by Export-CSV -NoType <# path and file name #>.

The most simple line is:
Get-PublicFolderStatistics | Export-CSV -NoTYpe C:\Temp\EE\PublicFolderStats.csv

Open in new window

0
 

Author Comment

by:nav2567
ID: 41763662
I tried as you said before creating this question:
Get-PublicFolderStatistics | Export-CSV -NoTYpe C:\Temp\EE\PublicFolderStats.csv.

Get-PublicFolderStatistics is fine.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41763684
Well, I tried too, and my results are fine. Your screenshot is doubtless the result of using format-table.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:nav2567
ID: 41764214
The reason I am using FT is because I need to list certain pieces of information in the statistics.

get-publicfolderstatistics -resultsize unlimited | ft creationtime,lastaccesstime,.....

Without ft being specified, my parameters will not be recognized.  

Thanks.
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 41764260
As I've told, you use Select-Object instead.
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 41764654
@Qlemo: a long week?
$stats = get-publicfolderstatistics -resultsize unlimited |  select-object creationtime,lastaccesstime,andothers
$stats | format-table
$stats | Export-CSV -NoTypeInformation C:\Temp\EE\PublicFolderStats.csv.

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses

722 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