Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VBS & WMI and Network Adapter Configuration

44 views
Skip to first unread message

Mike

unread,
Apr 7, 2003, 3:50:43 PM4/7/03
to
Hi,

I am having some problems with setting up my Network
Adapter via VBScript. I am using WMI and the methods
described in the MSDN Library. The method I am having
problems with is:

The SetDNSSuffixSearchOrder WMI class static method uses
an array of string elements to set the suffix search
order. This is an instance-independent call that applies
to all adapters for Windows NT-only.

uint32 SetDNSSuffixSearchOrder(
string DNSDomainSuffixSearchOrder[]);
Parameters
DNSDomainSuffixSearchOrder
List of server IP addresses suffixes to query for DNS
servers.
Example: 130.215.24.1 or 157.54.164.1

**** Shouldn't this read microsoft.com msn.com ??*******

Here is thescript so far; everything beu the last statment
works.

'* Create an Array of ComputerNames
strComputerNames = split("ComputerName2 ComputerName3
ComputerName4 ComputerName5 ComputerName6 ComputerName7
ComputerName8")

'* Iterate through each name in the array
For I = 0 to Ubound(strComputerNames)
WScript.Echo "Connecting to WMI Service on: " &
strComputerNames(I)

'* Connect to WMI service on remote system
Set objWMIService = GetObject("winmgmts:\\" &
strComputerNames(I) & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery("Select *
from Win32_NetworkAdapterConfiguration Where IPEnabled =
True")

'* Enumerate Network Adapters with IPEnabled
For Each objAdapter in colAdapters
WScript.Echo "Modifying Network Adapter: " &
objAdapter.Description
objAdapter.SetWINSServer "10.88.39.58", "10.30.10.50"
objAdapter.SetDNSServerSearchOrder Split
("10.88.39.56 10.30.10.52")
objAdapter.SetDNSDomain "MyCompany.com"
objAdapter.SetDNSDomainSuffixSearchOrder Split
("MyCompany.com MyOtherCo.com")

Next
Next


0 new messages