【发布时间】:2011-03-26 11:31:37
【问题描述】:
我正在尝试检测远程计算机上的 Internet Explorer 版本。在用谷歌搜索后,我写了这个。我正在本地机器上测试它
$pc = "."
$key = "SOFTWARE\Microsoft\Internet Explorer"
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $pc)
$regKey = $reg.OpenSubKey($key)
$regkey.GetValue("Version")
但它会给我带来很多错误。
Eccezione durante la chiamata di "OpenRemoteBaseKey" con "2" argomento/i: "Impossibile trovare il percorso di rete.
"
In riga:3 car:56
+ $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey <<<< ('LocalMachine', $pc)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Impossibile chiamare un metodo su un'espressione con valore null.
In riga:4 car:26
+ $regKey = $reg.OpenSubKey <<<< ($key)
+ CategoryInfo : InvalidOperation: (OpenSubKey:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Impossibile chiamare un metodo su un'espressione con valore null.
In riga:5 car:17
+ $regkey.GetValue <<<< ("Version")
+ CategoryInfo : InvalidOperation: (GetValue:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
希望有人能给我一些建议。谢谢。 编辑。我找到了这个链接 http://archive.msdn.microsoft.com/PSRemoteRegistry
这个模块对于查询远程机器上的注册表是绝对必要的吗?
【问题讨论】:
-
嗨。错误消息是意大利语,但如果它可以帮助我尝试翻译它。我会编辑我的帖子。