myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Change location of cache folder with script?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Change location of cache folder with script? Page: [1]
Login
Message << Older Topic   Newer Topic >>
Change location of cache folder with script? - 9/5/2008 12:08:49 PM   
jfraser174

 

Posts: 170
Score: 0
Joined: 2/24/2004
Status: offline
Anyone have any scripts I can package and deploy to change the location of the clients cache folder and another one to delete its contents if needed?  Thanks!
Post #: 1
RE: Change location of cache folder with script? - 9/5/2008 1:49:18 PM   
skissinger


Posts: 2114
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
There's a section in the SDK with this script.  I haven't tested it, but looks like it has the elements within it for changing the location.
quote:


Example

The following example method sets the Configuration Manager client cache location with the supplied path and then displays the cache properties.
For information about calling the sample code, see How to Call Configuration Manager COM Automation Objects.




Visual Basic Script 




Sub SetCacheLocation(path)

On Error Resume Next

Dim oUIResManager
Dim oCache
Dim oCacheElements

Set oUIResManager = createobject("UIResource.UIResourceMgr")

If oUIResManager Is Nothing Then
wscript.echo "Couldn't create Resource Manager - quitting"
Exit Sub
End If

Set oCache=oUIResManager.GetCacheInfo()

If oCache Is Nothing Then
Set oUIResManager=Nothing
WScript.Echo "Couldn't get cache info - quitting"
Exit Sub
End If

oCache.Location = path

WScript.Echo "Cache information " & oCache.Location

WScript.Echo "Location: " & oCache.Location

Wscript.Echo "Total size: " & oCache.TotalSize & " MB"
WScript.Echo "Free size: " & oCache.FreeSize & " MB"
WScript.Echo "Reserved: " & oCache.ReservedSize & " MB"
'WScript.Echo "Max Duration: " & oCache.MaxCacheDuration & " minutes"
' Wscript.Echo "TombStone Duration: " & oCache.TombStone.Duration & " minutes"

Set oCacheElements=oCache.GetCacheElements

WScript.Echo "There are " & oCacheElements.Count & " cache elements"
WScript.Echo

For Each oCacheElement In oCacheElements
WScript.Echo "Program Name: " & oCacheElement.CacheElementID
Next

Set oUIResManager=Nothing
Set oCache=Nothing

End Sub
 And, here's a clearcache script:  http://www.myitforum.com/articles/8/view.asp?id=7798

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to jfraser174)
Post #: 2
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Change location of cache folder with script? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.281