AnsweredAssumed Answered

Get Backup logs from Multiple PI servers

Question asked by bm_1212 on Nov 19, 2018

Hi

Hoping for some advice and tips here-

I have a script to pull some details from the PI logs for a list of PI servers for some housekeeping checks

My problem is that when I try to add the machine name into the output it just returns the last server name in the list for all server values

 

If anyone has any advice it would be much appreciated

 

Heres my code

 

Get-Content  "P:\Powershell\Friday Checks\Pi_servers.txt" |

ForEach-Object{

 

Get-PIBackupSummary -Connection (Connect-PIDataArchive -PIDataArchiveMachineName $_)

 

|

 

Where-Object{ $_.StatusMessage -eq '[0] Success'} |

Select-Object @{Name="Server";Expression={$Server}},status,statusmessage,type,backupend |

Export-Csv  "P:\Powershell\Friday Checks\Log_Errors.csv" -NoTypeInformation -Encoding UTF8 

 

Outcomes