strQuery = "SELECT " & strProperties & " FROM " & objClass & " WHERE IPEnabled = True AND ServiceName <> 'AsyncMac' AND ServiceName <> 'VMnetx' AND ServiceName <> 'VMnetadapter' AND ServiceName <> 'Rasl2tp' AND ServiceName <> 'PptpMiniport' AND ServiceName <> 'Raspti' AND ServiceName <> 'NDISWan' AND ServiceName <> 'RasPppoe' AND ServiceName <> 'NdisIP' AND ServiceName <> ''"
Set colAdapters = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
Pergunta
Nandao
Prezados,
Abaixo segue um script que informa as configuracoes de qualquer computador!!!
Desde o S.O ate processador...
Porem eu não consigo de jeito algum, fazer com que ele me traga o barramento da memória ram...
se alguém`poder ajudar..... :unsure:
Preciso que ele me informe todas as opcoes já existentes ( mais ) o barramento da memoria...
um grande abraco ..
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
NomeComputador = objItem.Caption
Next
'----------------------------- Cria o arquivo
Dim fso, txtfile
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtfile = fso.CreateTextFile("\\192.168.0.1\Relatorio Hardware\" & NomeComputador & ".html", True)
txtfile.Write ("<strong>Relatório de Hardware:</strong><br><br>")
txtfile.WriteBlankLines(3)
'--------------- Software
strComputer = "."
strProperties = "*"'"CSName, Caption, OSType, Version, OSProductSuite, BuildNumber, ProductType, OSLanguage, CSDVersion, InstallDate, RegisteredUser, Organization, SerialNumber, WindowsDirectory, SystemDirectory"
objClass = "Win32_OperatingSystem"
strQuery = "SELECT " & strProperties & " FROM " & objClass
Set colOS = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem in colOS
txtfile.Write ("<inventario>")
'===================================================================================
txtfile.write ("<strong>Nome do Computador:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.CSName)
txtfile.WriteBlankLines(1)
txtfile.write ("<br><strong>Sistema Operacional:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.Caption)
txtfile.WriteBlankLines(1)
If SO_Type = 16 Then
SO_Name = "Microsoft Windows 95</strong><br>"
ElseIf SO_Type = 17 Then
SO_Name = "Microsoft Windows 98"
End If
If SO_ProdType = 1 Then
SO_ProdType = "Estação de Trabalho"
ElseIf SO_ProdType = 2 Then
SO_ProdType = "Controlador de Domínio"
ElseIf SO_ProdType = 3 Then
SO_ProdType = "Servidor"
End If
If SO_Language = 1033 Then
SO_Language = "Inglês - Estados Unidos"
ElseIf SO_Language = 1046 Then
SO_Language = "Português - Brasil"
Else
SO_Language = "Outro idioma"
End If
If SO_Suite = 1 Then
SO_Suite = "Small Business"
ElseIf SO_Suite = 2 Then
SO_Suite = "Enterprise"
ElseIf SO_Suite = 4 Then
SO_Suite = "Backoffice"
ElseIf SO_Suite = 8 Then
SO_Suite = "Communication Server"
ElseIf SO_Suite = 16 Then
SO_Suite = "Terminal Server"
ElseIf SO_Suite = 18 Then
SO_Suite = "Enterprise e Terminal Server"
ElseIf SO_Suite = 32 Then
SO_Suite = "Small Business (Restrito)"
ElseIf SO_Suite = 64 Then
SO_Suite = "Embedded NT"
ElseIf SO_Suite = 128 Then
SO_Suite = "Data Center"
ElseIf SO_Suite = 256 Then
SO_Suite = "Single User"
ElseIf SO_Suite = 512 Then
SO_Suite = "Personal"
ElseIf SO_Suite = 1024 Then
SO_Suite = "Blade"
End If
Next
'------------------------------------------------------ Usuario----
txtfile.WriteBlankLines(1)
txtfile.write ("<br><strong>Usuário:</strong>")
txtfile.WriteBlankLines(1)
objClass = "Win32_ComputerSystem"
strQuery = "SELECT " & strProperties & " FROM " & objClass
Set colSys = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem in colSys
txtfile.write (objItem.UserName)
txtfile.WriteBlankLines(1)
Next
'-------------------------------Processador3
txtfile.write("<br><strong>Processador:</strong>")
txtfile.WriteBlankLines(1)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Processor",,48)
For Each objItem in colItems
'------------------------------------------------- Nome do processador
txtfile.write (objItem.name)
txtfile.WriteBlankLines(1)
'------------------------------------------------- Clock
txtfile.write ("<br><strong>Clock:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.CurrentClockSpeed & " MHZ")
txtfile.WriteBlankLines(1)
Next
'----------------------------------Memoria
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_physicalmemory",,48)
For Each objItem in colItems
'------------------------------------------------- Nome do Banco
'------------------------------------------------- Capacidade
txtfile.write ("<br><strong>Memórias:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.capacity/1048576)
txtfile.WriteBlankLines(1)
Next
'---------------------------------- hd
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_diskdrive",,48)
For Each objItem in colItems
'------------------------------------------------- modelo do disco
txtfile.write ("<br><strong>Modelo do Disco:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.caption)
txtfile.WriteBlankLines(1)
'----------------------------------------------------- Tamanho
txtfile.write ("<br><strong>Tamanho:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (int(objItem.size/1073741824) & " GB")
txtfile.WriteBlankLines(1)
Next
'------------------------------------------------- Nome do adaptador
strComputer = "."
strProperties = "Description, MACAddress, IPAddress, IPSubnet, DefaultIPGateway, DNSServerSearchOrder, DNSDomain, DNSDomainSuffixSearchOrder, DHCPEnabled, DHCPServer, WINSPrimaryServer, WINSSecondaryServer, ServiceName"
objClass = "Win32_NetworkAdapterConfiguration"
strQuery = "SELECT " & strProperties & " FROM " & objClass & " WHERE IPEnabled = True AND ServiceName <> 'AsyncMac' AND ServiceName <> 'VMnetx' AND ServiceName <> 'VMnetadapter' AND ServiceName <> 'Rasl2tp' AND ServiceName <> 'PptpMiniport' AND ServiceName <> 'Raspti' AND ServiceName <> 'NDISWan' AND ServiceName <> 'RasPppoe' AND ServiceName <> 'NdisIP' AND ServiceName <> ''"
Set colAdapters = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
'--------------------------------------------------------rede
For Each objItem in colAdapters
'For Each objItem in colItems
txtfile.write ("<br><strong>Adaptador:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.Description)
txtfile.WriteBlankLines(1)
'------------------------------------------------- IP
'txtfile.write ("<br><strong>Sistema Operacional:</strong>")
txtfile.write ("<br><strong>Endereco de IP:</strong>")
txtfile.WriteBlankLines(1)
IP_Address = objItem.IPAddress
txtfile.write (IP_Address(i))
txtfile.WriteBlankLines(1)
'===========================================================================
Next
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.