if strComputer = "" then Msgbox"Du skal indtaste et maskinenummer" else
Set SystemSet = GetObject( winmgmt1 ).InstancesOf ("Win32_Product")
Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2") Set colAdapters = objWMIService.ExecQuery _ ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True") n = 1
set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"& strComputer &"").ExecQuery("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem")
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems OS = OS & objOperatingSystem.Caption
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& strComputer &"" Set SPSet = GetObject( winmgmt1 ).InstancesOf ("Win32_OperatingSystem") Set UserSet = GetObject( winmgmt1 ).InstancesOf ("Win32_ComputerSystem")
'WScript.Echo winmgmt1
Set SNSet = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
for each Bios in GetObject( winmgmt1).InstancesOf ("win32_bios") BiosSerial = BiosSerial & Bios.SerialNumber
for each User in UserSet userList = userList & user.username
for each SN in SNSet
For each SP in SPSet Servicepack = Servicepack & SP.CSDVersion
For Each objAdapter in colAdapters
dnssuffix = dnssuffix & objAdapter.DNSDomain
If Not IsNull(objAdapter.DNSDomainSuffixSearchOrder) Then For i = 0 To UBound(objAdapter.DNSDomainSuffixSearchOrder)
objAdapter.DNSDomainSuffixSearchOrder(i) Next End If
If Not IsNull(objAdapter.DefaultIPGateway) Then For i = 0 To UBound(objAdapter.DefaultIPGateway) dgateway = dgateway & objAdapter.DefaultIPGateway(i) Next End If
next
for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) IPAddress = IPAddress & IPConfig.IPAddress(i) next end if next
Set sProperty = GetObject( winmgmt1 ).InstancesOf ("Win32_ComputerSystem")
For Each sProperty in GetObject( winmgmt1).InstancesOf ("Win32_ComputerSystem") model = model & DoCheckIfEmpty(sProperty.Model)
Dim WshLogonServer
Set WshShell = WScript.CreateObject("WScript.Shell")
Hej Maximus25, flot script - jeg kan nok bruge det til andet end lige denne opgave (som jeg efterhånden tror ikke kan løses via vbscript). Du må gerne få pointene.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.