Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Read registry on remote computer
Last Post 05 Mar 2010 01:27 PM by
PoSherLife
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Terry2win
New Member
Posts:39
04 Mar 2010 06:40 AM
Hello everybody.
I'm making a script to read certain information from the registry of a remote computer, such as when windows updates were last installed.
PS> $registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine","vistacomputer")
PS> $les= $registry.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install")
PS> $les.getValue("LastSuccessTime")
I'm running the script from my domain controller and "out" to the computer in the domain. My domain controller runs windows server 2008 r2. The script works when I run it against my exchange server which is the same operating system. However, when I run it against Windows Vista I cannot get it to work:
Error message:
Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
When running the script locally on the Vista computer it works fine, so the problem has to be the connection between the two computers. I can ping the Vista computer from the domain controller.
Thank you in advance.
PoSherLife
Basic Member
Posts:364
05 Mar 2010 01:27 PM
sounds like a firewall issue. is there a firewall installed on the vista computer?
also, you may try it with WMI:
$HKLM = 2147483650
$reg = GWMI -list -namespace root\default -computername vistacomputer| where-object { $_.name -eq "StdRegProv" }
$key = $reg.GetStringValue($HKLM,"Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install","LastSuccessTime")
When at first you don't succeed
Step-Into
http://theposherlife.blogspot.com
http://www.jandctravels.com
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2