?
Solved

How to output powershell in csv format

Posted on 2015-01-15
2
Medium Priority
?
246 Views
Last Modified: 2015-01-15
This script is used to return a list of users logged onto citrix servers.  Its output is in a text, space deliminated format.
How can the script be modified so it outputs in a comma seperated value (csv)?  This would make it easier to open in Excel.

add-pssnapin citrix* -erroraction silentlycontinue
#write-host (get-date) 

Get-xasession -farm | select-object -property @{N="Date Time";E={Get-date}},AccountName,ServerName,ClientName,BrowserName | Format-Table  -HideTableHeaders  -autosize



#get-xasession -farm | get-member 
#write-host (get-date) $env:computername
#write-host (get-date) $env:computername
#get-xasession -farm | select-object -property AccountName,ServerName,ClientName,BrowserName,ClientIPV4,SessionName | ft  -HideTableHeaders
#Get-xasession -farm | select-object -property @{N="Date Time";E={Get-date}},AccountName,ServerName,ClientName,BrowserName,ClientIPV4,SessionName | Format-Table  -HideTableHeaders  -autosize

Open in new window

0
Comment
Question by:epmmis
[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 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 40551923
In general and particular, you replace Format-* cmdlets by Export-CSV -NoType file.csv
0
 

Author Closing Comment

by:epmmis
ID: 40552363
Spot on answer.

Did learn that powershell 2 can not append to a .csv file.  Of course powershell is the installed version.  
Used a simple dos copy command to append the files

thanks
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

765 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