SCCM Client Cache Temizleme Scripti

July 23, 2010

Bilindiği gibi SCCM ile clientlar üzerinde distribution işlemini gerçekleştirdiğinizde bu dosyalar client üzerinde bulunan cache foldar’ına download edilir ve çalıştırılır.Bir süredir kullanılmayan dağıtım paketleri update paketleri bu dizinde kalacaktır.

Aşağıdaki script sayesinde 60 gündür refere edilmeyen öğeleri client üzerindeki cache dosyasından kaldırabilirsiniz.Tek yapmanız gereken bunuda bir program olarak dağıtmak.

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
 

posted in System Center, System Center Configuration Manager by Anıl ERDURAN

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org