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.
when you post code please format it as code using the “preformatted text” button (</> ).
Thanks in advance.
How much effort would it be for you to test it by yourself?
Regardless of that - you try to replace a string with the same string. That wouldn’t make any sense!?
Thank you for showing me the correct way to post code. Yes I have tried it myself and it’s only working for data on the same column. When I tried to replace td data on a different column it does not work.