I have created the script below and the values are being added into the CSV, but they are being duplicated on each line/column, example below.
RTC_Status RTME_Version UserName
Connected,Connected 2.6.0.2030,2.6.0.2030 domain\user1,domain\user2
Connected,Connected 2.6.0.2030,2.6.0.2030 domain\user1,domain\user2
$Array = @() ## Create Array to hold the Data $Computers = Get-Content -Path C:\Users\username\Downloads\Computernames.txt foreach ($Computer in $Computers) { $Result = "" | Select RTC_Status,RTME_Version,UserName $OS = Get-WMIObject -ComputerName $Computers -Namespace ROOT\Citrix\hdx\RTOptPack -Class Citrix_HDXRTConnector $username = Get-WmiObject -ComputerName $Computers –Class Win32_ComputerSystem $Result.RTC_Status = $OS.RTC_Status -join ',' $Result.RTME_Version = $OS.RTME_Version -join ',' $Result.UserName = $username.UserName -join ',' $Array += $Result ## Add the data to the array } $Array | Export-Csv C:\Users\username\Downloads\file.csv -NoTypeInformation