epmmis
asked on
How to output powershell in csv format
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.
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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