Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows XP / Security and Administration / July 2004

Tip: Looking for answers? Try searching our database.

WMI XP to XP via IP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karl Gray - 31 Jul 2004 18:53 GMT
 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
Carey Frisch  [MVP] - 31 Jul 2004 18:58 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.