This may very well overlap a few topics but I have a need for a PS script that I can assign to a Configuration Item and a Configuration Baseline. I have the PS scripts but need advice how to run the script as it fails due to the fact by default CM Clients run at the level of All Signed.
I thought I could just add at line 1 Set-ExecutionPolicy ByPass within the remediation script as follows
Any advice on if anyone has a better way of doing this.
Issue to resolve is the Client Cache length of time that the cache stays in the Client\Cache\CCMCache folder chewing up disk space. Especially on Servers that have been provisioned with only 80GB primary partitions.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
This may very well overlap a few topics but I have a need for a PS script that I can assign to a Configuration Item and a Configuration Baseline. I have the PS scripts but need advice how to run the script as it fails due to the fact by default CM Clients run at the level of All Signed.
I thought I could just add at line 1 Set-ExecutionPolicy ByPass within the remediation script as follows
Set-ExecutionPolicy ByPass
$MinDays = 14
$UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
$Cache = $UIResourceMgr.GetCacheInfo()
$Cache.GetCacheElements()|
where-object {[datetime]$_.LastReferenceTime -lt (get-date).adddays(-$mindays)}| foreach {$Cache.DeleteCacheElement($_.CacheElementID)}
Any advice on if anyone has a better way of doing this.
Issue to resolve is the Client Cache length of time that the cache stays in the Client\Cache\CCMCache folder chewing up disk space. Especially on Servers that have been provisioned with only 80GB primary partitions.
Share this post
Link to post
Share on other sites