Hi all - I've got a script that returns various PC details but for some reason the pagefile info isn't retrieved from remote PCs (shows as blank) but is retrieved fine if I enter my own PC as the target. Sometimes remote DNS/IP info is missing aswell but I'm not too worried about those oddities. Eg script below the PC info shows when remote PC is a target but pagefile doesn't - eg ideas?
_________________________________
Leozack
Code:
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Dim OutputTxt
' Here we initialize the variables for user interaction
Title = "Computer Name"
Message = "Enter Computer name"
' Ask for Computer name
strComputer = Trim(InputBox(Message,Title,"",5000,5000))
Set objshell = CreateObject("Wscript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
' PC
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
pcmake = objItem.Manufacturer
pcmodel = objItem.Model
pcname = objItem.Name
pctype = objItem.SystemType
pcmemory = objItem.TotalPhysicalMemory
pcusername = objItem.UserName
Next
' Pagefile
'set pcpagefile = wmic pagefileset GET maximumsize /value
'pcpagefile = Replace(objitem.MaximumSize,"MaximumSize=","")
set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PageFile", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
pagefilename = objitem.Name
pagefilesize1 = objitem.InitialSize
pagefilesize2 = objitem.MaximumSize
Next
_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);