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
For expert scripting advice:
Please visit the experts in the scripting newsgroup:
news://msnews.microsoft.com/microsoft.public.scripting.vbscript

Signature
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
[quoted text clipped - 21 lines]
|
| Wscript.echo StrMsg
Torgeir Bakken \(MVP\) - 31 Jul 2004 19:31 GMT
Carey Frisch [MVP] wrote:
> 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

Signature
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx