I need a programmatic way to move PFX files to web servers in untrusted domains and import them into the local cert store. The solution I have now is a batch file that performs the following:
- Use
NET USEto map a drive to an administrative share on the web server. - Use
XCOPYto move the PFX file to that share. - Use
PSEXECto invokeCERTUTILto import the PFX files.
Very crude and it doesn’t scale well. It works, but it isn’t elegant, and I have a feeling another scripting language may handle this better. Ideally, the script would programmatically replace the cert binding in IIS with the updated cert I just pushed to the server; now that’s a time-consuming, manual task through the GUI.
Since GUI’s Are For The Weak And Timid™, I’m looking at PowerShell to see how I can leverage that to carry out these tasks. Is that even the “right” or “best” language to consider? Do you have any suggestions how to improve this? Leave me a comment.
Discussion
No comments yet.