Closed idrositis closed 1 year ago
After some latest updates on our systems (after Sep/2021), we are getting the below error while running the script Clean-CMClientCache.ps1...
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
Weird, I'll try to reproduce.
Seems to be happening if peer cache is not enabled
CleanupActions
CacheType
CleanupType
Automatic
After some latest updates on our systems (after Sep/2021), we are getting the below error while running the script
Clean-CMClientCache.ps1
...Which is basically triggered by this call...
On Windows Server 2012 R2 and Windows Server 2016 machines.
For PS version 5.1+