I'm trying to detect internet explorer version on remote machine. After some search with google I've wrote this. I'm testing it on local machine
$pc = "."
$key = "SOFTWARE\Microsoft\Internet Explorer"
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $pc)
$regKey = $reg.OpenSubKey($key)
$regkey.GetValue("Version")
but it returns me a lot of errors.
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 <<&开发者_如何转开发lt;< ('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
I hope someone can give me some advice. Thanks. edit. I've found this link http://archive.msdn.microsoft.com/PSRemoteRegistry
Is this module absolutely necessary to query registry on remote machines?
You can query remote registry without that module. PSRemoteRegistry module only makes it easy. However, the requirement is to have remote registry service enabled and running on the remote machine. For an example, without the PSremoteRegistry module, check my blog post: http://www.ravichaganti.com/blog/?p=1920
Also, try at an elevated PowerShell console. You need admin rights to query remote registry. This is what I found on my system.
You know you can browse the registry just like files with Powershell?
PS> Enter-PSSession -Computername "computer"
PS[computer]> $reg = Get-Item ('HKLM:\Software\Microsoft\Internet Explorer\Version Vector')
PS[computer]> $reg.GetValue("IE")
Or maybe:
PS> Invoke-Command -computername "computer" { $reg = Get-Item ('HKLM:\Software\Microsoft\Internet Explorer\Version Vector'); $reg.GetValue("IE") }
You may have to use the -credentials parameter for any of those commands to get access. And have WinRM set-up on any of the machines you want to access.
Sounds simple but.. Go to remote PC through UNC path using explorer. Navigate to iexplore, right click, properties, details tab. IE info is there :)
精彩评论