WMI XP to XP via IP

G

Guest

I’ve been having a blast with WMI creating local administration scripts but I'm just not doing well with accessing networked PCs.
All PCs are XP pro sp1 over IP on... NetWare network (yeah, I know...) .

This Vbscript just reads out pagefile size min,max and current usage. So I can find the incorrectly manual configured PCs (a config best left to the OS). Problem : I have tried various approaches, but I'm still getting one error or another related to security on the target system "permission denied" etc. Works fine local when moniker is changed up (removed).


'Pagefileinfo.vbs'
Option explicit
Dim strMsg, strComputer, objWMIService, colItems, objItem

strComputer = inputbox ("Enter a valid PC netbios name", "Remote page file information retrieval")

' Collect page file info '
Set objWMIService = GetObject("Winmgmts:" _
& "{impersonationLevel=impersonate," _
& "authenticationLevel=pkt," _
& "authority=kerberos}!\\" _
& strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
("Select * from Win32_PageFile")
For Each objItem in colItems
strMsg = strMsg _
& "Initial size : mb " & objItem.InitialSize & vbCrLf _
& "Maximum size : mb " & objItem.MaximumSize & vbCrLf _
& "Current size : mb " & objItem.FileSize \ 1048576 & vbCrLf _
& "___________________" & vbCrLf
PageFile = objItem.MaximumSize
Next

Wscript.echo StrMsg
 
C

Carey Frisch [MVP]

For expert scripting advice:

Please visit the experts in the scripting newsgroup:
news://msnews.microsoft.com/microsoft.public.scripting.vbscript

--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User

Be Smart! Protect your PC!
http://www.microsoft.com/security/protect/

-----------------------------------------------------------------------------------------------


| I’ve been having a blast with WMI creating local administration scripts but I'm just not doing well with
accessing networked PCs.
| All PCs are XP pro sp1 over IP on... NetWare network (yeah, I know...) .
|
| This Vbscript just reads out pagefile size min,max and current usage. So I can find the incorrectly manual
configured PCs (a config best left to the OS). Problem : I have tried various approaches, but I'm still
getting one error or another related to security on the target system "permission denied" etc. Works fine
local when moniker is changed up (removed).
|
|
| 'Pagefileinfo.vbs'
| Option explicit
| Dim strMsg, strComputer, objWMIService, colItems, objItem
|
| strComputer = inputbox ("Enter a valid PC netbios name", "Remote page file information retrieval")
|
| ' Collect page file info '
| Set objWMIService = GetObject("Winmgmts:" _
| & "{impersonationLevel=impersonate," _
| & "authenticationLevel=pkt," _
| & "authority=kerberos}!\\" _
| & strComputer & "\root\cimv2")
|
| Set colItems = objWMIService.ExecQuery _
| ("Select * from Win32_PageFile")
| For Each objItem in colItems
| strMsg = strMsg _
| & "Initial size : mb " & objItem.InitialSize & vbCrLf _
| & "Maximum size : mb " & objItem.MaximumSize & vbCrLf _
| & "Current size : mb " & objItem.FileSize \ 1048576 & vbCrLf _
| & "___________________" & vbCrLf
| PageFile = objItem.MaximumSize
| Next
|
| Wscript.echo StrMsg
|
 
T

Torgeir Bakken \(MVP\)

Carey said:
For expert scripting advice:

Please visit the experts in the scripting newsgroup:
news://msnews.microsoft.com/microsoft.public.scripting.vbscript
Hi

For the OP's problem, this group would be better:

microsoft.public.win32.programmer.wmi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top