SOLVEDclear ccm cache ps script

E

erikdeklerck

Active Member
25
1
3
Hello everyone :

when executing this script on a local machine it clears the ccm cache :
## Initialize the CCM resource manager com object
[__comobject]$CCMComObject = New-Object -ComObject 'UIResource.UIResourceMgr'## Get the CacheElementIDs to delete
$CacheInfo = $CCMComObject.GetCacheInfo().GetCacheElements()## Remove cache items
ForEach ($CacheItem in $CacheInfo) {
$null = $CCMComObject.GetCacheInfo().DeleteCacheElement([string]$($CacheItem.CacheElementID))
}

但不是在sccm部署时,或任何建议other scripts ?
OP
E

erikdeklerck

Active Member
25
1
3
  • Thread Starter
  • #4
Based on this articel we are looking for a automated script to clear the ccm cache

when creating a package and deploying to a single device nothing is cleared.
Last edited:
OP
E

erikdeklerck

Active Member
25
1
3
  • Thread Starter
  • #12
Clean-CMClientCache.log : error 0x87D01203
Ccmexec is in use while the script tries to clear the cache.
So we could start a script form the client directly that starts another script that clears the cache and performs an exit ?
Garth

Garth

Well-Known Member
Staff member
1,638
136
63
Clean-CMClientCache.log : error 0x87D01203
Ccmexec is in use while the script tries to clear the cache.
So we could start a script form the client directly that starts another script that clears the cache and performs an exit ?
Where are you seeing this error? this doesn't look like it is coming from execmgr.log. Also this error says that something is running from the cache on no from the DP, like you said above.
J

jackaustin

New Member
4
0
1
I have over 250 GB of manual cache and I do not know what it contains, should I delete it, it takes up 25% of mySSD?
Last edited:
J

jconeal417

New Member
1
0
1
Hello,

I as well am tying to find a script for powershell that clears the ccmcache but no luck. Can anyone be of assistance?
N

n17

New Member
1
1
3
I use this PS to clean the ccmcache when needed:

## Initialize the CCM resource manager com object [__comobject]$CCMComObject = New-Object -ComObject 'UIResource.UIResourceMgr' ## Get the CacheElementIDs to delete $CacheInfo = $CCMComObject.GetCacheInfo().GetCacheElements() ## Remove cache items ForEach ($CacheItem in $CacheInfo) { $null = $CCMComObject.GetCacheInfo().DeleteCacheElement([string]$($CacheItem.CacheElementID)) }

I run it as a script from the console when needed.
M

m0rph

Member
18
2
3
$UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
$Cache = $UIResourceMgr.GetCacheInfo()
$Cache.GetCacheElements() |
foreach {
$Cache.DeleteCacheElement($_.CacheElementID)
}
Garth

Garth

Well-Known Member
Staff member
1,638
136
63
$UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
$Cache = $UIResourceMgr.GetCacheInfo()
$Cache.GetCacheElements() |
foreach {
$Cache.DeleteCacheElement($_.CacheElementID)
}
What is your question?

Latest posts

Forum statistics

Threads
5,494
Messages
21,382
Members
11,768
Latest member
fabianbl