Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Access Remote Worksation Registry

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,56359
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Access Remote Worksation Registry
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Access Remote Worksation Registry - 2/6/2008 12:13:52 AM   
  timothyfriend

 

Posts: 4
Score: 0
Joined: 2/5/2008
Status: offline
I create a script to access my local registry and display the value of the registry key.  Is it possible to access remote workstation to do the same thing?

DIM WshShell, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")
bKey = WshShell.RegRead ("HKLM\SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID")
REM WScript.Echo WshShell.RegRead ("HKLM\SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID"
WScript.Echo bKey
 
 
Post #: 1
 
 RE: Access Remote Worksation Registry - 2/6/2008 12:42:28 AM   
  SAPIENScripter


Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You need to use WMI to remotely read a registry

      

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to timothyfriend)
 
 
Post #: 2
 
 RE: Access Remote Worksation Registry - 2/6/2008 3:00:34 AM   
  timothyfriend

 

Posts: 4
Score: 0
Joined: 2/5/2008
Status: offline
I have tried using the code format for my process.  I put a workstation name in the
"strComputer =" and rem out the "For" statement. Just trying to test the script to move to the next step.

And finally I am trying to show the value of the registr key...


const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "computername"
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath ="SOFTWARE\ComputerAssociates\HostUUID\HOSTUUID"
rem objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValues
objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath
rem For x=0 To UBound(arrValues)-1
rem WScript.Echo arrValues(x)
rem next
WScript.Echo ?

I tried to echo different varibles and could not get the actal value.  The "HOSTUUID" is the key that has the value I have been trying to get displayed.


(in reply to SAPIENScripter)
 
 
Post #: 3
 
 RE: Access Remote Worksation Registry - 2/6/2008 3:23:32 AM   
  SAPIENScripter


Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
There's a bit more involved to read a specific key.  Assuming you need to read a string value, here is how you would do it:


      
There are different methods depending on the key type.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to timothyfriend)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Access Remote Worksation Registry Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts