Hi, I am trying to do the below.
- Read through a SQL server list from a text file
- Connecting to each server and select some fields from SQL Login properties
- Putting each server output to a .out file and finally concatenating all .out to one file.
- Export the .out file to CSV
- Convert the .CSV to html using ConvertTo-HTML.
I want to conditionally format the html table according to the String value in column 4 . This table has 6 columns and many rows.
I want to change the color of table data cell or entire row, if the value is “LOGIN EXPIRED”.
Example of the html table
Server Login PasswordLastSet DaystoExpire PasswordChecked Client
Test1 ab_67 1/25/2021 LOGIN EXPIRED YES C1
Test1 ab_63 1/25/2020 LOGIN EXPIRED YES C1
Test1 bb_67 5/25/2012 NEVER EXPIRE YES C1
Test1 ab_87 1/25/2012 NEVER EXPIRE YES C1
Test1 ab_47 1/25/2012 LOGIN EXPIRED YES C1
I am struggling to change the color of the cell if LOGIN EXPIRED found.
Any insight would be greatly helpful.