Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

List Archives

Subject: [ActiveDir] LIL OT system Reg size script
Prev Next
You are not authorized to post a reply.

AuthorMessages
AD000001365User is Offline

Posts:0

09/06/2005 3:01 AM  
We recently had an issue where a policy seems to be
causing the registry size to blow up on several of our servers.  We Believe
we have found the culprit policy and are looking into it but we want to monitor
things. On this front I am trying to put to gether a script that will go
thru a list of our servers and check the file sys of the system registry. 


i.e.  check
admin$\system32\config\system

here is what i
have


On Error Resume Next

Const ForReading = 1

Set objFSO =
CreateObject("Scripting.FileSystemObject")Set objTextFile =
objFSO.OpenTextFile("e:\scripts\servers.txt", ForReading)

Do Until objTextFile.AtEndOfStream    
strComputer = objTextFile.Readline

    '
=====================================================================   
' Insert your code here    '
=====================================================================

 WScript.Echo WScript.Echo
"==========================================" WScript.Echo "Computer:
" & strComputer WScript.Echo
"=========================================="

Set objFile =
objFSO.GetFile("admin$\system32\config\system")Set objItem =
strComputer.objFile

WScript.Echo "FileSize: " &
objItem.FileSize

    '
=====================================================================   
' End    '
=====================================================================

Loop

objTextFile.Close

Where am I going wrong?

Jeff
alainlissoirUser is Offline

Posts:3

09/06/2005 3:14 AM  
Why not using WMI to achieve this? Just keep the file list as you
did below and use WMI to update the registry size.

Check:
Sample
4.14 - SetWin32_RegistrySizeWithAPI (Direct Properties).wsf
or
Sample
4.15 - SetWin32_RegistrySizeWithAPI (Indirect
Properties).wsf
at http://www.lissware.net,
volume 1 samples.

HTH
/Alain
From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Cothern Jeff D.
Team EITCSent: Tuesday, September 06, 2005 8:00 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: [ActiveDir] LIL OT system Reg
size script

We recently had an issue where a policy seems to be
causing the registry size to blow up on several of our servers.  We Believe
we have found the culprit policy and are looking into it but we want to monitor
things. On this front I am trying to put to gether a script that will go
thru a list of our servers and check the file sys of the system registry. 


i.e.  check
admin$\system32\config\system

here is what i
have


On Error Resume Next

Const ForReading = 1

Set objFSO =
CreateObject("Scripting.FileSystemObject")Set objTextFile =
objFSO.OpenTextFile("e:\scripts\servers.txt", ForReading)

Do Until objTextFile.AtEndOfStream    
strComputer = objTextFile.Readline

    '
=====================================================================   
' Insert your code here    '
=====================================================================

 WScript.Echo WScript.Echo
"==========================================" WScript.Echo "Computer:
" & strComputer WScript.Echo
"=========================================="

Set objFile =
objFSO.GetFile("admin$\system32\config\system")Set objItem =
strComputer.objFile

WScript.Echo "FileSize: " &
objItem.FileSize

    '
=====================================================================   
' End    '
=====================================================================

Loop

objTextFile.Close

Where am I going wrong?

Jeff
kamleshapUser is Offline

Posts:26

09/06/2005 3:45 AM  
Set objFile = objFSO.GetFile( "\\" & strComputer & "\admin$\system32\config\system")

WScript.Echo "FileSize: " & objFile.FileSize

On 9/6/05, Alain Lissoir wrote:

Why not using WMI to achieve this? Just keep the file list as you did below and use WMI to update the registry size.

Check:
Sample 4.14 - SetWin32_RegistrySizeWithAPI (Direct Properties).wsf
or
Sample 4.15 - SetWin32_RegistrySizeWithAPI (Indirect Properties).wsf
at http://www.lissware.net, volume 1 samples.


HTH
/Alain
From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx [mailto:
ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Cothern Jeff D. Team EITCSent: Tuesday, September 06, 2005 8:00 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: [ActiveDir] LIL OT system Reg size script 
We recently had an issue where a policy seems to be causing the registry size to blow up on several of our servers.  We Believe we have found the culprit policy and are looking into it but we want to monitor things. On this front I am trying to put to gether a script that will go thru a list of our servers and check the file sys of the system registry. 


i.e.  check admin$\system32\config\system

here is what i have


On Error Resume Next

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")Set objTextFile = objFSO.OpenTextFile("e:\scripts\servers.txt", ForReading)


Do Until objTextFile.AtEndOfStream     strComputer = objTextFile.Readline

    ' =====================================================================    ' Insert your code here    ' =====================================================================


 WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer
 WScript.Echo "=========================================="

Set objFile = objFSO.GetFile("admin$\system32\config\system")Set objItem = strComputer.objFile

WScript.Echo "FileSize: " & objItem.FileSize

    ' =====================================================================    ' End    ' =====================================================================


Loop

objTextFile.Close

Where am I going wrong?

Jeff



 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~"Fortune and Love befriend the bold"
~~~~~~~~~~~~~~~~~~~~~~~~~~~
AD000001365User is Offline

Posts:0

09/06/2005 3:54 AM  
OK Add that to the number of books I must
get.

    In the meantime.  As I dont have the book
right now and I am very new to scripting.  What is the difference between
the Direct Properties and the Indirect Properties?

    Have started modifying but now having the
problems with setting the Computername.  In your script it is a const but I
need it as a variable so that it goes thru the list of our
Servers.

Thanks

Jeff

From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Alain
LissoirSent: Tuesday, September 06, 2005 11:13 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: RE: [ActiveDir] LIL OT system
Reg size script

Why not using WMI to achieve this? Just keep the file list as you
did below and use WMI to update the registry size.

Check:
Sample
4.14 - SetWin32_RegistrySizeWithAPI (Direct Properties).wsf
or
Sample
4.15 - SetWin32_RegistrySizeWithAPI (Indirect
Properties).wsf
at http://www.lissware.net,
volume 1 samples.

HTH
/Alain
From: ActiveDir-owner@xxxxxxxxxxxxxxxxxx
[mailto:ActiveDir-owner@xxxxxxxxxxxxxxxxxx] On Behalf Of Cothern Jeff D.
Team EITCSent: Tuesday, September 06, 2005 8:00 AMTo:
ActiveDir@xxxxxxxxxxxxxxxxxxSubject: [ActiveDir] LIL OT system Reg
size script

We recently had an issue where a policy seems to be
causing the registry size to blow up on several of our servers.  We Believe
we have found the culprit policy and are looking into it but we want to monitor
things. On this front I am trying to put to gether a script that will go
thru a list of our servers and check the file sys of the system registry. 


i.e.  check
admin$\system32\config\system

here is what i
have


On Error Resume Next

Const ForReading = 1

Set objFSO =
CreateObject("Scripting.FileSystemObject")Set objTextFile =
objFSO.OpenTextFile("e:\scripts\servers.txt", ForReading)

Do Until objTextFile.AtEndOfStream    
strComputer = objTextFile.Readline

    '
=====================================================================   
' Insert your code here    '
=====================================================================

 WScript.Echo WScript.Echo
"==========================================" WScript.Echo "Computer:
" & strComputer WScript.Echo
"=========================================="

Set objFile =
objFSO.GetFile("admin$\system32\config\system")Set objItem =
strComputer.objFile

WScript.Echo "FileSize: " &
objItem.FileSize

    '
=====================================================================   
' End    '
=====================================================================

Loop

objTextFile.Close

Where am I going wrong?

Jeff
You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > [ActiveDir] LIL OT system Reg size script



ActiveForums 3.7
AdventNet Banner
Friends

Friends

Namescape
Members

Members

MembershipMembership:
Latest New UserLatest:adamswifty
New TodayNew Today:2
New YesterdayNew Yesterday:2
User CountOverall:4263

People OnlinePeople Online:
VisitorsVisitors:71
MembersMembers:0
TotalTotal:71

Online NowOnline Now:

Ads

Copyright 2008 ActiveDir.org
Terms Of Use