Hej NG
Jeg har allerede en bat med efterfølgende vbs fil der kan give mig
flere af oplysningerne.
Det jeg mangler er at der også kommer de sidste (gerne 2 eller 3) der
har være logget på PC'en (deres brugernavn)
Kan man på nogen måde få det lavet så der kun er én fil og ikke to?
Hilsen
Sten
Bat:
cscript pcinfo.vbs > %computername%.txt
vbs filen:
' ********************************
' Udskriv standardoplysninger om PC
' - udskrives til .txt-fil
' ---------------------------------------
' Forfatter: Klaus Jørgensen i dk.edb.hardware 11.9.07
' ********************************
'
' Køres med fx:
' cscript pcinfo.vbs > %computername%_%date%.txt
Function CnvDate(pDate)
CnvDate = CDate(Mid(pDate, 7, 2) & "/" & _
Mid(pDate, 5, 2) & "/" & Left(pDate, 4) _
& " " & Mid (pDate, 9, 2) & ":" & _
Mid(pDate, 11, 2) & ":" & Mid(pDate, _
13, 2))
End Function
On Error Resume Next
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(".","\root\CIMV2")
Set colSettings = objWMIService.ExecQuery("SELECT * FROM
Win32_ComputerSystem",,48)
For Each objComputer In colSettings
Result=objComputer.Name
Wscript.Echo "Host: " & objComputer.Name
Wscript.Echo "Manufacturer: " & objComputer.Manufacturer
Wscript.Echo "Model: " & objComputer.Model
Next
Set colItems = objWMIService.ExecQuery("Select * from
Win32_BaseBoard",,48)
For Each objItem In colItems
Wscript.Echo "Product: " & objItem.Product
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem In colItems
Wscript.Echo "Username: " & objItem.username
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem In colItems
Wscript.Echo "SerialNumber: " & objItem.SerialNumber
Next
Set colItems = objWMIService.ExecQuery("Select * from
Win32_Processor",,48)
TotalCPU = 0
strCPU = ""
For Each objItem In colItems
strCPU = Trim(objItem.Name)
TotalCPU = TotalCPU + 1
Next
If TotalCPU>0 Then Wscript.Echo "CPU: " & TotalCPU & " * " & strCPU
Set colItems = objWMIService.ExecQuery("Select * from
Win32_PhysicalMemory where MemoryType<>11",,48)
TotalMemory = 0
s = ""
For Each objItem In colItems
If s<>"" Then s = s & "+"
s = s & objItem.Capacity / 1024^2 & "Mb"
TotalMemory = TotalMemory + objItem.Capacity
Next
If TotalMemory>0 Then Wscript.Echo "Memory: " & TotalMemory / 1048576
& "Mb (" & s & ")"
Set colDiskDrives = objWMIService.ExecQuery("SELECT * FROM
Win32_DiskDrive",,48)
TotalDisk = 0
s = ""
For each objItem In colDiskDrives
If s<>"" Then s = s & "+"
s = s & Round(objItem.Size / 1024^3) & "Gb"
TotalDisk = TotalDisk + Round(objItem.Size / 1024^3)
Next
If TotalDisk>0 Then Wscript.Echo "Disk Size: " & TotalDisk & "Gb (" &
s & ")"
Set colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.Caption & " " &
objOperatingSystem.Version
Next
Set IPConfigSet = objWMIService.ExecQuery("Select
IPAddress,DefaultIPGateway,IPSubnet from
Win32_NetworkAdapterConfiguration ")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo "IP Address: " & IPConfig.IPAddress(i)
WScript.Echo "IP Gateway: " & IPConfig.DefaultIPGateway(i)
WScript.Echo "IP Subnet: " & IPConfig.IPSubnet(i)
Next
End If
Next
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_NetworkAdapterConfiguration where IPEnabled=TRUE",,48)
For Each objItem in colItems
Wscript.Echo "IPSubnet: " & objItem.IPSubnet
Next
|