我想调用Clearprojexp.exe作为runas不同的用户。有什么方法可以将(Powershell)安全字符串凭据传递给runas命令吗?
我试图为使用遵循我的PowerShell提示符
runas /noprofile /user:Domain\UserName Clearprojexp -credential (Powershellfile.ps1 -get "E:\EncryptedPwd.txt")
但它要求手动输入密码。由于PowerShell提供了将密码作为加密字符串存储在文件中,有什么办法可以从文件传递加密密码吗?
我的意图是运行一个脚本来打开Clearcase项目浏览器作为runas不同的用户。
有一个/ Savecred选项,但我不确定它是否会以安全形式存储密码。
其他Powerhell的想法:http://social。 technet.microsoft.com/Forums/en-US/winserverpowershell/thread/132e170f-e3e8-4178-9454-e37bfccd39ea/,http://gallery.technet.microsoft.com/scriptcenter/PowerShell-function-to-3e9766e3(其中是上述脚本的较短版本),http://blogs.msdn.com/b/alanpa/archive/2006/08/16/703031.aspx – VonC 2012-03-30 10:36:39