Re: Win32_NetworkAdapter



DC001 wrote:
I see that SPEED is a property under this class but it is not working for me.
Is there any way that i can get speed/Duplex of the network?

Please reply ASAP.

Thanks in Adv.

I don't know about duplex, but here is speed.



'Function to get NIC speed(s)
'
'ToddFeller@xxxxxxxxx

Option explicit

Dim strServerName
Dim strUser,StrPass
Dim retValue

strServerName=""
strUser=""
StrPass=""

retValue=f_getAdapterSpeed(strServerName,strUser,StrPass)

MsgBox(retValue)

Function f_getAdapterSpeed(strServerName,strUser,StrPass)

Dim objlocator,objWBEMServicesWMI
dim objWBEMCollAdapterSpeeds,objWBEMAdapterSpeed

Set objlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWBEMServicesWMI = objlocator.ConnectServer(strServerName, _
"root\wmi",strUser,StrPass)

Set objWBEMCollAdapterSpeeds = objWBEMServicesWMI.ExecQuery _
("select * from MSNdis_LinkSpeed where active=true")
For Each objWBEMAdapterSpeed In objWBEMCollAdapterSpeeds
f_getAdapterSpeed=f_getAdapterSpeed & _
objWBEMAdapterSpeed.InstanceName & chr(32) & _
formatnumber(objWBEMAdapterSpeed.NdisLinkSpeed/10000,0,,,-1) & _
vbCrLf
Next


End Function

.



Relevant Pages

  • Re: Problem with execution order in print routine
    ... ByVal hPrinter As Long, ByVal pDeviceName As String, _ ... ' Programmatically set the Duplex flag for the specified printer ... Dim pd As PRINTER_DEFAULTS ... Dim nRet As Long, nJunk As Long ...
    (microsoft.public.word.vba.general)
  • RE: Need Help | Rolling out new App. | Trouble with some computers.
    ... Is the PC hard wired to the network or using wireless? ... Option Compare Database ... Dim varReturn As Variant ... Dim lngAuth As Long, strDept As String, strFirst As String, strLast As ...
    (microsoft.public.access.modulesdaovba)
  • RE: Network Connection Issue?
    ... Intermittent network problems can be very difficult to diagnose. ... Dim procCurrent as String ... Dim FileName as String ... 'time to open an Excel file; ...
    (microsoft.public.access.externaldata)
  • RE: Network Connection Issue?
    ... Intermittent network problems can be very difficult to diagnose. ... Dim procCurrent as String ... Dim FileName as String ... 'time to open an Excel file; ...
    (microsoft.public.access.externaldata)
  • Re: VBA Duplex - Access Denied - Can only read settings - VB6 can set Duplex
    ... Any ideas on how to set to Duplex mode when the user does not have ... Public Type PRINTER_DEFAULTS ... Public Declare Function DocumentProperties Lib "winspool.drv" _ ... Dim pd As PRINTER_DEFAULTS ...
    (microsoft.public.office.developer.vba)

Loading