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:


  


clearing cache on mass

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

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> clearing cache on mass Page: [1]
Login
Message << Older Topic   Newer Topic >>
clearing cache on mass - 8/19/2008 11:03:52 AM   
ssumgirl

 

Posts: 186
Score: 0
Joined: 11/24/2004
Status: offline
Is there a right way to clear caches for machines? Or is it as simple as blwoing aways everything in the cache folder? I am guessing that doing so might result in some advertisement failure, but I am contemplating the possiblity of needing to do this on a collection wide basis for a particular effort, and i am just sort of wondering aloud.
Post #: 1
RE: clearing cache on mass - 8/19/2008 11:16:29 AM   
bwoodall

 

Posts: 48
Score: 0
Joined: 5/6/2008
Status: offline
EDIT: This script works with SMS 2003 and I haven't tested it with SCCM 2007

Copy the text below into notepad and name it clearcache.vbs then create a package and advertise it to a collection. Make sure you run it from the distribution point and not download to the computer. If the computer downloads the script it will fail due to deleting its own self.


on error resume next
dim oUIResManager
dim oCache
dim oCacheElement
dim oCacheElements
set oUIResManager = createobject("UIResource.UIResourceMgr")
if oUIResManager is nothing then
    wscript.echo "Couldn't create Resource Manager - quitting"
    wscript.quit
end if
set oCache=oUIResManager.GetCacheInfo()
if oCache is nothing then
    set oUIResManager=nothing
    wscript.echo "Couldn't get cache info - quitting"
    wscript.quit
end if
set oCacheElements=oCache.GetCacheElements
for each oCacheElement in oCacheElements
oCache.DeleteCacheElement(oCacheElement.CacheElementID)
next
set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing

< Message edited by bwoodall -- 8/19/2008 11:18:37 AM >

(in reply to ssumgirl)
Post #: 2
RE: clearing cache on mass - 8/27/2008 3:38:17 PM   
jbenoit

 

Posts: 22
Score: 0
Joined: 4/4/2008
Status: offline
I just tried this with ConfigMgr 2007 and the Advertisement reports successfully running the VB script, but the cache is not emptied...

(in reply to bwoodall)
Post #: 3
RE: clearing cache on mass - 8/27/2008 4:31:58 PM   
jsandys


Posts: 531
Score: 17
Joined: 3/24/2005
From: San Antonio, TX
Status: offline
Try the SMS Collection Commander from Roger Zander: http://sourceforge.net/projects/smscollctr/.  This is an open source, stand-alone project that uses documented APIs to perform common clients actions on collections of client resources.  Works on both ConfigMgr and SMS2003.

_____________________________

Jason
________________________________________
http://myitforum.com/cs2/blogs/jsandys/default.aspx

(in reply to jbenoit)
Post #: 4
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> clearing cache on mass 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.203