Script to monitor Domain Controller trust

I just came across this powershell script that checks the trust between computers and the domain and attempts to repair them if they are broken. I was hoping this could get Made into a custom monitoring script. I am not sure how to run ps scripts with python and get output back into comodo.

https://4sysops.com/archives/repair-the-domain-trust-relationship-with-test-computersecurechannel/

Hello @drewwcomputers ,

This could be possible.
We will get in touch with you shortly via email for further analysis.
Thank you.

@drewwcomputers

Thank you for contacting us for your script request. We will update you once completed.​​​​​​​

do you think that we could modify the end of the code, so that in the end instead of raising an alert run the command “Test-ComputerSecureChannel -Repair” and print “Repair attempted” and also raise an alert to double check if it was successful.

Hi @drewwcomputers

We will modify the script as per your requirement and update you soon.

Thank You