CrystalDiskInfo Communityscript Not Working

Hi Community,

Did somebody achieve to get this Community Script running?

CrystalDiskInfo Portable MASTER TEMPLATE

I just don’t get it, tried everything i can setting the variables, it just doesn’t work.

Script outpout i get:

“Rmm alert: success error> System.Net.WebException: The underlying connection was closed: No trust could be established for the protected SSL/TLS channel. error> Stack: error> at Invoke-WebRequest20, C:\ProgramData\Syncro\bin\module.psm1: line 309 error> at Call-SyncroApi, C:\ProgramData\Syncro\bin\module.psm1: line 238 error> at Create-Syncro-Ticket, …”

Sorry it’s translated from German. I set the variables $subdomain and $email and also added crystaldiskinfo.zip as required file, but i still get this error.

Perhaps someone is able to provide help as i see that the script was added about 325 times to MSPs library before this post…

thanks

Hi Robert,

sadly we don’t use this script the only tip i can give is how to get more information.
i use mostly the Powershell ISE and remove all syncro stuff and test it on the machine that has this problem. i guess it could be a old pwershell version installed on the system or it requires some security exceptions (Certificate problem).

i had a script that required a Exception maybe it works here too (needs to be on top):

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
        ServicePoint srvPoint, X509Certificate certificate,
        WebRequest request, int certificateProblem) {
        return true;
    }
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

hope i could help a bit.

Beste Grüsse aus der Schweiz :upside_down_face:

Hi,

Thank you, with this added it’s “better” now but i still get this error:

System.Net.WebException: the remote server returned an error: (422) Unprocessable Entity.
error> HTTP Status: 422 ‘422’
error> Content-Type: ‘application/json; charset=utf-8’
error> Response: ‘[“User can’t be blank”]’
error> Stack:
error> bei Invoke-WebRequest20, C:\ProgramData\Syncro\bin\module.psm1: Zeile 326
error> bei Call-SyncroApiEx, C:\ProgramData\Syncro\bin\module.psm1: Zeile 253
error> bei Call-SyncroApi, C:\ProgramData\Syncro\bin\module.psm1: Zeile 228
error> bei Create-Syncro-Ticket-TimerEntry, C:\ProgramData\Syncro\bin\module.psm1: Zeile 183
error> bei , C:\ProgramData\Syncro\bin\515cf7c6-4494-4835-92c6-c615e5ac81ea.ps1: Zeile 56
error> bei , : Zeile 1
error> bei , : Zeile 1
error> Call-SyncroApi: failure

But the first 3 lines of the script output are now “Call-SyncroApi: success” which is better, so we are making progress!

(Beste Grüsse aus Luxemburg ;))

second last line could be the problem:
Create-Syncro-Ticket-TimerEntry -Subdomain $subdomain -TicketIdOrNumber $ticket -StartTime $startat -DurationMinutes $duration -Notes “Automated system performed task.” -UserIdOrEmail $email

sometimes the string variable have to be inside the " " (and yes it sounds not logic :grinning_face_with_smiling_eyes:):
FROM -UserIdOrEmail $email TO -UserIdOrEmail “$email”

Fix:
Create-Syncro-Ticket-TimerEntry -Subdomain $subdomain -TicketIdOrNumber $ticket -StartTime $startat -DurationMinutes $duration -Notes “Automated system performed task.” -UserIdOrEmail “$email”

I found out what’s causing the problem. It’s not the “$email” as suggested, it depends on what Email Address you set at the variable $email. I used our generic Email Address but i had to pick an Email Address which is used by a Syncro User. For example if i take mine, the script runs well.

But now i see that it creates an Alert every time it’s running, i was hoping that it only creates an alert when there are bad SMART values… So this script is only good when you have a suspicion that a HDD/SSD could be faulty… Not for monitoring. Probably useful as automated remediation procedure when a SMART error from the integrated SMART tool of Syncro sends an error to get more SMART Info.

I was hoping to find something which is more accurate than the integrated Syncro check, because it doesn’t work that well (isn’t aggressive enough)

Thanks anyway for your help, without it i wouldn’t have managed to get this done!

okey pitty,
yes you can activate on the device or in the Policy the SMART Detection.
On Server some Raid Controllers (Example HP) are creating Event Entrys.
We also use SMNP with ILO to monitor Server failers as backup.

A Custom Script could be a option to get more feedback. the Commands are existing.

Doc: https://www.tenforums.com/tutorials/163843-how-check-drive-health-smart-status-windows-10-a.html