0

I want to run commands from Powershell and/or cmd.exe on a Windows host. These commands might accept, as parameters, passwords which should not be saved anywhere.

These scripts may need to run from some automated process, so a password prompt won't fly.

This is, naturally, something I'd like to prevent from sitting around on the server. Which ways might Windows retain (in history, logs, etc) prior command data like parameter content, and how might I prevent it from doing so?

Thanks very much for any insight.

Articles like Working With Passwords... in Powershell suggest I won't have a problem (implies you can just write passwords right into the shell), and community answers don't exactly prove it's safe, but one community answer could let me know it is unsafe. :)

1
  • Are you authenticating against AD? Maybe certificates would work for that scenario although I can't find any good resources online at the moment.
    – brndr
    Sep 3, 2015 at 11:57

1 Answer 1

0

Once a PowerShell session is closed, all data specific to that session is disposed (unless you've installed third party programs to log anything).

So unless you've installed something to cause an effect otherwise, or you're specifically saving data to a file or the registry, nothing is retained.

EDIT: PowerShell 5.0 seems to have implemented persistent history. You may need to run Clear-History if you are running PowerShell 5+

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .