Solved

getting registry size in wmi or vb

Posted on 2006-06-13
5
534 Views
Last Modified: 2012-06-27
Hey, I want to be able to get the registry size of a windows 2000 workstation. It would be cool if it could loop through and get a bunch of machine names.
0
Comment
Question by:tuckcorp
5 Comments
 
LVL 6

Expert Comment

by:Booda2us
ID: 16896959
1. In Control Panel, double-click System.  
2. On the Performance tab, click Change in the Virtual Memory section.  
3. In the Virtual Memory dialog box, in the Registry Size section, the current registry size and the maximum registry size are displayed.  I hope this helps you out...Booda2us
0
 

Author Comment

by:tuckcorp
ID: 16897021
Thanks, but I need a way to connect to a remote machine and get this info
0
 
LVL 9

Accepted Solution

by:
Krompton earned 500 total points
ID: 16897123
tuckcorp,
Try this...

Save this as a .vbs file
Change the (".",".") to ("computer01","computer2",etc...)

'********************
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array(".",".")
For Each strComputer In arrComputers
   Msg = Msg & VBCrLf & "Computer Registry Info for: " & strComputer

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Registry", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      Msg = Msg & VBCrLf & "CurrentSize: " & objItem.CurrentSize
      Msg = Msg & VBCrLf & "MaximumSize: " & objItem.MaximumSize
      Msg = Msg & VBCrLf & "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
      Msg = Msg & VBCrLf & "Name: " & objItem.Name
      Msg = Msg & VBCrLf & "Status: " & objItem.Status
      Msg = Msg & VBCrLf
      Msg = Msg & VBCrLf
   Next
Next
   WScript.Echo Msg


Function WMIDateStringToDate(dtmDate)
      WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
      Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
      & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

'********************
0
 
LVL 13

Expert Comment

by:haim96
ID: 16897189
there is a tool by microsoft named: DUREG.EXE
that check your registry size. you can download it free from
here :
https://www.microsoft.com/downloads/details.aspx?familyid=1562BCE1-A45E-4445-90A7-6E0342E5DC03&displaylang=en

about WMI , well i hope this one will work for you:
 '**********************************************+
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Registry",,48)

For Each objItem in colItems
   WScript.Echo "Caption: " & objItem.Caption
   WScript.Echo "CurrentSize: " & objItem.CurrentSize
   WScript.Echo "Description: " & objItem.Description
   WScript.Echo "InstallDate: " & objItem.InstallDate
   WScript.Echo "MaximumSize: " & objItem.MaximumSize
   WScript.Echo "Name: " & objItem.Name
   WScript.Echo "ProposedSize: " & objItem.ProposedSize
   WScript.Echo "Status: " & objItem.Status
   WScript.Echo ""
Next

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_UserInDomain",,48)

For Each objItem in colItems
   WScript.Echo "GroupComponent: " & objItem.GroupComponent
   WScript.Echo "PartComponent: " & objItem.PartComponent
   WScript.Echo ""
Next

'*******************************************************

it's from :
http://www.adminscripteditor.com/scriptlibrary/view.asp?id=351

0
 
LVL 9

Expert Comment

by:Krompton
ID: 16901709
BTW...

there are a number of very useful scripts available at
     http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx

You can also download the Scriptomatic(V2) tool and create basic scripts you can modify quickly (quickly :) depends on your scripting knowledge of course) to suit your needs. That's where I created the one in my previous post. Took about 2 min.

Cheers,
Krompton
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now