mem-zone / mem.zone Goto Github PK
View Code? Open in Web Editor NEWOur โก collection of PowerShell scripts and Endpoint Management related stuff ๐ต
Home Page: https://MEM.Zone/GIT
License: GNU General Public License v3.0
Our โก collection of PowerShell scripts and Endpoint Management related stuff ๐ต
Home Page: https://MEM.Zone/GIT
License: GNU General Public License v3.0
Dedicated devices has the worst and non-descriptive names.
After some latest updates on our systems (after Sep/2021), we are getting the below error while running the script Clean-CMClientCache.ps1
...
PS C:\Tools> .\Clean-CMClientCache.ps1
Get-CimInstance : Invalid class
At C:\Tools\Clean-CMClientCache.ps1:1601 char:32
+ ... SuperPeer = Get-CimInstance -Namespace 'root\ccm\Policy\Machine\Actua ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (root\ccm\Policy...eerClientConfig:String) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
[10-29-2021 13:10:53.315] [Main:CleanupResult] [Clean-CMClientCache] :: TotalDeletedSize: 0
Which is basically triggered by this call...
PS C:\Tools> Get-CimInstance -Namespace 'root\ccm\Policy\Machine\ActualConfig' -ClassName 'CCM_SuperPeerClientConfig' -Verbose:$true
VERBOSE: Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\ccm\Policy\Machine\ActualConfig,'className' =
CCM_SuperPeerClientConfig'.
Get-CimInstance : Invalid class
At line:1 char:1
+ Get-CimInstance -Namespace 'root\ccm\Policy\Machine\ActualConfig' -Cl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (root\ccm\Policy...eerClientConfig:String) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
VERBOSE: Operation 'Enumerate CimInstances' complete.
On Windows Server 2012 R2 and Windows Server 2016 machines.
For PS version 5.1+
PS C:\Tools> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Hi loan,
I was looking to upgrade from the Technet version of this script (as this version seems so much more polished!) however I'm noticing in testing that most of the content in my test devices cache's is being skipped over.
I'm using the following Parameters:
Action = All
FreeSpace = 100
OlderThan = 0
$RemovePersisted = $true
SkipSuperPeer = $false
For Example on one Server I have 10 Cache Entries mostly containing Update CAB's at around 1.5gig each some of which are from January this year, but running the script doesn't seem to detect they're to be removed.
Checking the last referenced time in WMI shows they're old.
$Cachepath = ([wmi]"ROOT\ccm\SoftMgmtAgent:CacheConfig.ConfigKey='Cache'").Location
$cache = get-wmiobject -query "SELECT * FROM CacheInfoEx" -namespace "ROOT\ccm\SoftMgmtAgent"
Foreach ($cacheitem in $cache) {
$cacheitem.contentID
[Management.ManagementDateTimeConverter]::ToDateTime($cacheitem.LastReferenced)
}
NCU00008
21 January 2020 00:40:45
448ef3f9-86e9-497b-954e-653286ad418f
01 April 2020 01:33:28
NCU00003
28 November 2019 14:14:37
NCU00003
13 February 2020 16:19:56
8a7ad16e-b78e-4b88-91fe-35362d9b69a7
02 June 2020 04:41:12
9b842fe4-2040-40fe-be18-4b88dd88950f
05 February 2020 01:50:05
381e77dc-f15f-4c71-84e1-32d60f26e71a
01 April 2020 01:32:12
a0203bcb-ff0e-42cb-99de-72f265c2426e
08 January 2020 01:25:04
24a6254e-dea0-4acd-ac4f-ae70abd62cdc
19 February 2020 01:22:35
aff2af4a-fb0d-4371-9c90-24a42b3fe359
15 February 2020 04:54:03
Hello,
I read the code of the file HWI extension for reporting sql server in sccm
I think the line 231 should be Release = "2019"; and not Release = "2017";
Thanks
Howdy Ioan,
I found an issue if you have no users that have logged onto the device yet, at least in my environment, you get an error when trying to populate the $Packages variable. The error is a generic failure when trying to access the namespace. I would suggest adding ErrorAction SilentlyContinue to that line as so. I will try to attach the full error if I can get to it.
$Packages = Get-CimInstance -Namespace 'Root\ccm\ClientSDK' -ClassName 'CCM_Program' -Verbose:$false -ErrorAction SilenetlyContinue
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
It's not related to a problem. But thanks for potentially considering it!
Describe the solution you'd like
A clear and concise description of what you want to happen.
A formatted email, containing the list of computers that were disabled, so as to inform managers/colleagues/Service Desk of the computers that were disabled, should a user call in.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I've cobbled together my own, but it could be more elegant.
Additional context
Add any other context or screenshots about the feature request here.
This was even after making sure the DataSet was pointed correctly
An error has occurred during report processing. (rsProcessingAborted)
I'm hoping this isn't a simple mistake on my part but running this script on a device with administrative access and 35 separate items in the ccmcache results in only 2 being visible when the script is run. I have tried modifying the thresholds as I want it to be fairly aggressive in it's cleanup but it will not spot the remaining 33 items.
No errors logged, results below:
PS C:\sparke\scripts> .\Clean-CMClientCache.ps1 -verbose
VERBOSE: [03-08-2022 16:45:11.436] [Main:Initialization] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.530] [Main:Initialization] [Clean-CMClientCache] :: Should Run test passed
VERBOSE: [03-08-2022 16:45:11.530] [Main:Initialization] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:11.546] [Remove-CCMCachedApplications] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.561] [Get-CCMCachedApplications] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.655] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:11.671] [Remove-CCMCachedApplications] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:11.682] [Remove-CCMCachedPackages] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.687] [Get-CCMCachedPackages] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.735] [Get-CCMCachedPackages] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:11.735] [Remove-CCMCachedPackages] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:11.751] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:11.751] [Get-CCMCachedUpdates] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:13.235] [Get-CCMCachedUpdates] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:13.235] [Remove-CCMCachedUpdates] [Clean-CMClientCache] :: Stop
VERBOSE: [03-08-2022 16:45:13.250] [Remove-CCMOrphanedCache] [Clean-CMClientCache] :: Start
VERBOSE: [03-08-2022 16:45:13.409] [Remove-CCMOrphanedCache] [Clean-CMClientCache] :: Stop
[03-08-2022 16:45:13.425] [Main:CleanupResult] [Clean-CMClientCache] ::
FullName :
Name : 5009469
Location : C:\WINDOWS\ccmcache\1r
LastReferenceTime : 1/03/2022 2:33:08 AM
Size(MB) :
Status : Needed
FullName :
Name : 5008880
Location : C:\WINDOWS\ccmcache\1s
LastReferenceTime : 1/03/2022 2:33:57 AM
Size(MB) :
Status : Needed
TotalDeletedSize: 0
VERBOSE: [03-08-2022 16:45:13.425] [Main:CleanupResult] [Clean-CMClientCache] :: Stop
PS C:\sparke\scripts>
Any idea's what may be going on here?
Describe the bug
Even though disk cleanup launch and run properly, it stays open forever in the background and I have to manually kill the process every single time.
Maybe a kill command could be launched after a certain wait time?
Expected behavior
Disk Cleanup should close automatically when done and the script should continue.
Desktop (please complete the following information):
Describe the bug
When running the script several times on a machines it keeps getting less and less free space. Where does the space go.
Normally the script should be run once, thats where I found that I had less free space then before running the script.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The free space should be consistant
Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.