如何在 PowerShell 中使用 Windows odbcconf CONFIGSYSDSN 或 Set-OdbcDsn 存储加密的 dp{加密密码}
当我通过 Windows“ODBC 数据源管理器”对话框窗口编辑 ODBC 数据源中的密码时,密码以加密方式存储在 Windows 注册表中,例如 encrypted-dp{encrypted-password}
。
当我使用 odbcconf CONFIGSYSDSN 编辑密码时,它以纯文本形式存储在注册表中。
有没有一种方法可以像 Windows ODBC 对话框窗口一样使用编程方式/脚本存储数据源密码?
When I edit a password in ODBC Data Source through a Windows "ODBC Data Source Administrator" dialog window, the password is stored in an encrypted manner like encrypted-dp{encrypted-password}
in Windows registry.
When I edit the password using odbcconf CONFIGSYSDSN
, it is stored as plain text in the registry.
Is there a way to store a data source password using programmatic way/script in the same way as the Windows ODBC dialog window does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在本例中,它是一个正在编辑数据源属性的外部库,加密不是 Windows 进程的一部分。
当通过数据源编辑窗口更改属性时,该库对密码进行加密 - 该窗口已经是来自该库的专有第三方窗口。
我们从供应商那里得到了公开的“加密”方法,因此我们在使用 PowerShell 时也可以自己加密密码。
In this case, it was an external library, which was editing data source properties, encryption wasn't made as a part of the Windows process.
This lib was encrypting the password when changing the properties over the Data Source edit window - which was already a proprietary 3rd party window, coming from the lib.
We got an exposed "encrypt" method from the vendor, so we can also encrypt the password ourselves when using PowerShell.