4 minutes ago, Barb said:
Hi
I am using this DS and getting a situation where in the AD script is picking up the instances but in the collector attributes script it no longer finds the instances. Thou other servers in same environment it works perfectly. Any assistance to help debug, work this out is much appreciated. I cant find any difference in the instances collected in the AD script
More than likely it is a permissions problem on the server either for calling PowerShell remotely, or for actual script block (below).
$ScriptBlock = {
param (
[bool]$Debug,
[String]$SerialNumber
)
if ($Cert = Get-ChildItem -Path cert:LocalMachine -Recurse | Where-Object { $_.SerialNumber -eq $SerialNumber }) {
# NotAfter can return multiple values, we'll just take the first (zeroth) one using [0]
$TimeSpan = New-TimeSpan -Start (Get-Date) -End $Cert.NotAfter[0]
$DaysLeft = $TimeSpan.Days
Write-Host "DaysLeft=$DaysLeft"
}
}
You might find more detail in the wrapper.log on your collector as far as what errors are happening (or possibly via Poll Now). NOTE: this code may have changed a bit since the last publication -- I think we did some work to skip replaced certificates at some point. I just pushed out the latest iteration (ZZKW9P), but it will need to be reviewed again.