Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Machine DNS list 1

Status
Not open for further replies.

tltechie

Technical User
Apr 25, 2011
17
US
I have been working on this script for awhile and i cannot get it to work remotely with a variable from a larger script. RemoteMachine is the variable being worked with. I basically need the searchlist for the dns to be used with the variable,






function readFromRegistry (strRegistryKey, strDefault )

Dim WSHShell, value

On Error Resume Next

Set WSHShell = CreateObject("WScript.Shell")

value = WSHShell.RegRead( strRegistryKey )


if err.number <> 0 then

readFromRegistry= strDefault

else

readFromRegistry=value

end if


set WSHShell = nothing
end function

str = readfromRegistry("\\" & remotemachine & "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\SearchList")
wscript.echo "returned " & str
 
ABSOLUTELY PERFECT!! Thank you so much for you help works wonders after some small tweaking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top