none
Modificar script ya echo, con lineas de otro. RRS feed

  • Pregunta

  • Tengo este script

    winmgt = "winmgmts:{impersonationLevel=impersonate}!//"
    Set oWMI_Qeury_Result = GetObject(winmgt).InstancesOf("Win32_ComputerSystem")
    
    For Each oItem In oWMI_Qeury_Result
    Set oComputer = oItem
    Next
    
    If IsNull(oComputer.Model) Then
      sComputerModel = "*no-name* model"
    Else
      If LCase(oComputer.Model) = "system product name" Then
        sComputerModel =  "Custom-built PC"
      Else
        sComputerModel =  oComputer.Model
      End If
    End If
    
    If IsNull(oComputer.Manufacturer) Then
      sComputerManufacturer = "*no-name* manufacturer"
    Else
      If LCase(oComputer.Manufacturer) = "system manufacturer" Then
        sComputerManufacturer =  "some assembler"
      Else
        sComputerManufacturer =  oComputer.Manufacturer
      End If
    End If
    
    sComputer = Trim(sComputerModel) & " by " & Trim(sComputerManufacturer)
    Echo sComputer

    Esto es para decir fabricante.

    Despues tengo este otro script que estoy metiendo por los puestos.

    dim NIC1, Nic, StrIP, CompName
    
    Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
    
    For Each Nic in NIC1
    
    if Nic.IPEnabled then
    
    StrIP = Nic.IPAddress(i)
    
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    
    CompName= WshNetwork.Computername
    
    MsgBox "IP Address:  "&StrIP & vbNewLine _
     & "Computer Name:  "&CompName,4160,"IP Address and Computer Name"
    
    wscript.quit
    
    end if
    
    next

    Este ultimo dice la ip y hostname, pero querría que dijer 2 cosas más.

    DNS y FABRICANTE

    ¿Me echais una mano?

    Gracias.


    viernes, 20 de abril de 2018 7:06