VBScript to Set SMS Client Cache Size
Simple VBScript for setting the client cache size.
----Begin VBScript----
On Error Resume Next
' Declare Variables
Dim checkCacheValue
Dim setCacheValue
' Set the Cache Size to check for (less than or equal to)
checkCacheValue = 1024
' If less than or equal to the checkCacheValue
' set the Cache Size to this
setCacheValue= 1024
Dim oUIResourceMgr
Dim oCache
Set oUIResourceMgr = CreateObject("UIResource.UIResourceMgr")
Set oCacheInfo = oUIResourceMgr.GetCacheInfo
' Set it if it's less than or equal to checkCacheValue
if oCacheInfo.TotalSize <= checkCacheValue then
oCacheInfo.TotalSize = setCacheValue
end if
'Return the error so SMS can report it
WScript.Quit(Err)
----End VBScript----
----Begin VBScript----
On Error Resume Next
' Declare Variables
Dim checkCacheValue
Dim setCacheValue
' Set the Cache Size to check for (less than or equal to)
checkCacheValue = 1024
' If less than or equal to the checkCacheValue
' set the Cache Size to this
setCacheValue= 1024
Dim oUIResourceMgr
Dim oCache
Set oUIResourceMgr = CreateObject("UIResource.UIResourceMgr")
Set oCacheInfo = oUIResourceMgr.GetCacheInfo
' Set it if it's less than or equal to checkCacheValue
if oCacheInfo.TotalSize <= checkCacheValue then
oCacheInfo.TotalSize = setCacheValue
end if
'Return the error so SMS can report it
WScript.Quit(Err)
----End VBScript----
About the Author
Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin."
Ready to move from VBScript to the Cloud? Check out his book, Pro PowerShell for Amazon Web Services.
Visit EmmanuelTsouris.com for his latest projects.
As an Amazon Associate, I earn from qualifying purchases at no cost to you.
Comments