>lparameters tcComputer, tcUser, tcPassword >local loWMI, loConnections, loConnection, lcComputer > >lcComputer = Iif(Vartype(tcComputer) = "C" and not Empty(tcComputer), tcComputer, ".") >lcUser = iif(vartype(tcUser) = "C", tcUser, "") >lcPassword = iif(vartype(tcPassword) = "C", tcPassword, "") > >lcDomain = getenv('USERDNSDOMAIN') >loLocator = createobject('WbemScripting.SWbemLocator') >try > if empty(lcUser) > loWMI = loLocator.ConnectServer(lcComputer) > else > loWMI = loLocator.ConnectServer(lcComputer, 'root\cimv2', lcUser, lcPassword) > endif >catch > loWMI = null >endtry > >if not isnull(loWMI) > loConnections = loWMI.ExecQuery("select * from Win32_NetworkAdapter where availability=3 and MACAddress<>null") > clear > ? '-------------------------------------------------------' > For Each loConnection in loConnections > with loConnection > ? .AdapterType > ? .AdapterTypeID > ? .Availability > ? .Caption > ? .Description > ? .DeviceID > ? .MACAddress > ? .Name > ? .NetConnectionID > ? .ServiceName > ? '******************************************************' > endwith > Endfor >endif >>