gpt4 book ai didi

windows - 无法使用 powershell 从 32 位版本的 win2008 读取 64 位注册表项

转载 作者:可可西里 更新时间:2023-11-01 11:29:17 25 4
gpt4 key购买 nike

我尝试使用 powershell 从 32 位 Windows 2008 读取 64 位版本的 Windows Server 2008 r2 上的以下注册表项,但该值显示为空白并且不返回任何值。

可以帮助我了解如何从 32 位服务器读取 64 位注册 key 吗?

$line = "WIN-QENOBBC64B8"
$regkey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $line)
$ref = $regKey.OpenSubKey("SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL")
$ref

最佳答案

在 32 位 powershell 中,您可以通过从命令行调用 64 位版本的 reg.exe 来访问 64 位注册表。诀窍在于使用 sysnative 路径而不是 system32,这会让您脱离 syswow64 沙箱并进入真正的 64 位注册表。

C:\Windows\SysNative\reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"

关于windows - 无法使用 powershell 从 32 位版本的 win2008 读取 64 位注册表项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25082808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com