I am curious if it is possible to script the modifications referenced in
Q311218. This is not a simple export/import of a registry key, but rather a
modification to a key on each computer due to GUID references.

Thanks,
Bob

Re: Script for Q311218 by Torgeir

Torgeir
Tue Mar 15 14:13:05 CST 2005

Bob Williamson wrote:

> I am curious if it is possible to script the modifications referenced
> in Q311218. This is not a simple export/import of a registry key, but
> rather a modification to a key on each computer due to GUID references.
Hi

This should do it I think:


'--------------------8<----------------------

Const HKLM = &H80000002

sComputer = "."

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

sKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Linkage"
sValueName = "Bind"

oReg.GetMultiStringValue HKLM, sKeyPath, sValueName, arValues

arValuesNew = Array()

For i = 0 To UBound(arValues)
If i = 0 Then
If LCase(arValues(i)) = "\device\ndiswanip" Then
' entry is alredy first in the list, no point in continuing
Exit For
Else
' put NdisWanIp in the first element in the new array
ReDim Preserve arValuesNew(0)
arValuesNew(0) = "\Device\NdisWanIp"
End If
End If

If LCase(arValues(i)) <> "\device\ndiswanip" Then
iCountNew = UBound(arValuesNew) + 1
ReDim Preserve arValuesNew(iCountNew)
arValuesNew(iCountNew) = arValues(i)
End If
Next

If UBound(arValuesNew) > -1 Then
oReg.SetMultiStringValue HKLM, sKeyPath, sValueName, arValuesNew
End If


'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Script for Q311218 by Bob

Bob
Wed Mar 16 10:48:04 CST 2005

I am happy to report it seems to work fine. I am sorry to report it makes
very little sense to me!

Also, there has been an ongoing discussion regarding this matter at
isaserver.org as well as the NNTP ISA group.

http://forums.isaserver.org/ultimatebb.cgi?ubb=get_topic;f=30;t=000514#000016

Mr. Shinder, who is Mr. ISA Server in many people's books and runs the
isaserver.org site, is quite interested in contacting you regarding this
matter.

Thanks for your help on this,
Bob

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:Odn%23KuZKFHA.4064@tk2msftngp13.phx.gbl...
> Bob Williamson wrote:
>
>> I am curious if it is possible to script the modifications referenced
>> in Q311218. This is not a simple export/import of a registry key, but
>> rather a modification to a key on each computer due to GUID references.
> Hi
>
> This should do it I think:
>
>
> '--------------------8<----------------------
>
> Const HKLM = &H80000002
>
> sComputer = "."
>
> Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
> & sComputer & "\root\default:StdRegProv")
>
> sKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Linkage"
> sValueName = "Bind"
>
> oReg.GetMultiStringValue HKLM, sKeyPath, sValueName, arValues
>
> arValuesNew = Array()
>
> For i = 0 To UBound(arValues)
> If i = 0 Then
> If LCase(arValues(i)) = "\device\ndiswanip" Then
> ' entry is alredy first in the list, no point in continuing
> Exit For
> Else
> ' put NdisWanIp in the first element in the new array
> ReDim Preserve arValuesNew(0)
> arValuesNew(0) = "\Device\NdisWanIp"
> End If
> End If
>
> If LCase(arValues(i)) <> "\device\ndiswanip" Then
> iCountNew = UBound(arValuesNew) + 1
> ReDim Preserve arValuesNew(iCountNew)
> arValuesNew(iCountNew) = arValues(i)
> End If
> Next
>
> If UBound(arValuesNew) > -1 Then
> oReg.SetMultiStringValue HKLM, sKeyPath, sValueName, arValuesNew
> End If
>
>
> '--------------------8<----------------------
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Re: Script for Q311218 by Torgeir

Torgeir
Wed Mar 16 11:29:11 CST 2005

Bob Williamson wrote:

> I am happy to report it seems to work fine. I am sorry to report it makes
> very little sense to me!
>
> Also, there has been an ongoing discussion regarding this matter at
> isaserver.org as well as the NNTP ISA group.
>
> http://forums.isaserver.org/ultimatebb.cgi?ubb=get_topic;f=30;t=000514#000016
>
> Mr. Shinder, who is Mr. ISA Server in many people's books and runs the
> isaserver.org site, is quite interested in contacting you regarding this
> matter.
Hi

From the link I see you have forwarded my e-mail address to him, that is ok.
Note that the "-spam" part needs to be removed to be able to reach me.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx