Forum Discussion
Cole_McDonald
Professor
6 years agoHere's the change I made to the 2 scripts in the DS:
# if ($hostname -eq $collectorName){ #!!! CTM 20190807 if ("##system.collector##" -eq "true"){
First line is the original statement in the scripts commented out (and tagged with my initials and the date of change for auditing later)
This does grab the collectors correctly, but the non-collectors still don't quite work, but this is where I'm going with it... back to troubleshooting.
The payload of the scripts does work directly from the collector, so it should be a sound method of collecting this data.
$server = "servername_to_test_goes_here"
$scriptBlock = {
Get-ChildItem Cert:\LocalMachine\My, Cert:\LocalMachine\AuthRoot, Cert:\LocalMachine\Root `
| Select-Object {$_.Thumbprint + "##" + $_.Thumbprint + "##" + $_.Subject + $_.FriendlyName} `
| Format-Table -HideTableHeaders
}
Invoke-Command -ComputerName $server -ScriptBlock $scriptBlock