Hi all,
The following works great on a local machine, however when I change the "."
to "Servername" The EnumKey fails. How can I enumerate on remote
computers?On Error Resume Next

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Services\WMI"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys
WScript.Echo subkey
Next
Thanks in advance.

Re: Enumerate registry on remote computers? by W

W
Thu Oct 23 21:15:23 CDT 2003

Paul,

The "." value for strComputer mean "this machine". Replace "." with the
remove computer name and it should work.
If it doesn't you may need to get a copy of regobj.dll and some code found
at http://cwashington.netreach.net that uses this DLL.

"Paul E. Surette" <Paul.Surette@lcbo.com_removethis> wrote in message
news:OU453eXmDHA.3312@tk2msftngp13.phx.gbl...
> Hi all,
> The following works great on a local machine, however when I change the
"."
> to "Servername" The EnumKey fails. How can I enumerate on remote
> computers?On Error Resume Next
>
> const HKEY_LOCAL_MACHINE = &H80000002
> strComputer = "."
>
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> strComputer & "\root\default:StdRegProv")
>
> strKeyPath = "SYSTEM\CurrentControlSet\Services\WMI"
> oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
>
> For Each subkey In arrSubKeys
> WScript.Echo subkey
> Next
> Thanks in advance.
>
>



Re: Enumerate registry on remote computers? by Paul

Paul
Fri Oct 24 06:50:23 CDT 2003

Thanks I'll try the suggestion, and yes I know the "." means this machine.
Thanks again.


"W. C. Hull"
<PleaseSubstituteMyFirstInitialMidInitialLastName51Here@hotmail.com> wrote
in message news:%W%lb.23841$Y1.3891@nwrddc03.gnilink.net...
> Paul,
>
> The "." value for strComputer mean "this machine". Replace "." with the
> remove computer name and it should work.
> If it doesn't you may need to get a copy of regobj.dll and some code found
> at http://cwashington.netreach.net that uses this DLL.
>
> "Paul E. Surette" <Paul.Surette@lcbo.com_removethis> wrote in message
> news:OU453eXmDHA.3312@tk2msftngp13.phx.gbl...
> > Hi all,
> > The following works great on a local machine, however when I change the
> "."
> > to "Servername" The EnumKey fails. How can I enumerate on remote
> > computers?On Error Resume Next
> >
> > const HKEY_LOCAL_MACHINE = &H80000002
> > strComputer = "."
> >
> > Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> > strComputer & "\root\default:StdRegProv")
> >
> > strKeyPath = "SYSTEM\CurrentControlSet\Services\WMI"
> > oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
> >
> > For Each subkey In arrSubKeys
> > WScript.Echo subkey
> > Next
> > Thanks in advance.
> >
> >
>
>



Re: Enumerate registry on remote computers? by Phil

Phil
Fri Oct 24 13:43:07 CDT 2003

This should get you started

' VBScript source code

Const HKEY_CLASSES_ROOT = &H80000000

Const HKEY_CURRENT_USER = &H80000001

Const HKEY_LOCAL_MACHINE = &H80000002

Const HKEY_USERS = &H80000003

Const HKEY_CURRENT_CONFIG= &H80000005

Const HKEY_DYN_DATA = &H80000006

Const REG_SZ = 1

Const REG_EXPAND_SZ = 2

Const REG_BINARY = 3

Const REG_DWORD = 4

Const REG_MULTI_SZ = 7

Dim Regpath 'path in the registry

Regpath = "some\path\don't\include\HKLM"

comp_name = inputbox("Enter the name of the computer you wish to query")

Set objReg = GetObject("winmgmts://" & comp_name &
"/root/default:StdRegProv")

'wscript.echo objReg.value

RC = objReg.GetStringValue(HKEY_CURRENT_CONFIG, Regpath, "some key in path",
RegBudget)

wscript.echo "." & Regbudget & "."

wscript.echo RC '0 if all went well

if RegBudget = Empty Then

wscript.echo "Null"

End if

"Paul E. Surette" <Paul.Surette@lcbo.com_removethis> wrote in message
news:OU453eXmDHA.3312@tk2msftngp13.phx.gbl...
> Hi all,
> The following works great on a local machine, however when I change the
"."
> to "Servername" The EnumKey fails. How can I enumerate on remote
> computers?On Error Resume Next
>
> const HKEY_LOCAL_MACHINE = &H80000002
> strComputer = "."
>
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> strComputer & "\root\default:StdRegProv")
>
> strKeyPath = "SYSTEM\CurrentControlSet\Services\WMI"
> oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
>
> For Each subkey In arrSubKeys
> WScript.Echo subkey
> Next
> Thanks in advance.
>
>