EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
MIT License
526 stars 58 forks source link

Access denied on DC kills Testimo #117

Closed AJDurant closed 3 years ago

AJDurant commented 3 years ago

Doing the full run (Invoke-Testimo) I now get:

      [i][ad.XXXXXX.com][dc00.ad.XXXXXX.com] Resolves internal DNS queriesInvoke-CommandCustom : Exception calling "Invoke" with "0" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:
[dc00.ad.XXXXXX.com] Connecting to remote server dc00.ad.XXXXXX.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help
topic."
At C:\Program Files\WindowsPowerShell\Modules\Testimo\0.0.50\Testimo.psm1:4544 char:37
+ ... putInvoke = Invoke-CommandCustom -ScriptBlock $CurrentSource['Data']  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-CommandCustom], MethodInvocationException
    + FullyQualifiedErrorId : ActionPreferenceStopException,Invoke-CommandCustom

Access is denied because the user I'm running as can't login to the DC, but this should fail the test rather than kill the whole script.

PrzemyslawKlys commented 3 years ago

Yes, it was like that before, but ever since 0.45 I've started rebuilding internals for new features and it seems to forgot to do try/catch. I'll fix this today.

AJDurant commented 3 years ago

Thanks for the quick responses, running with the right permissions now completes for me, so this is minor. Time to start digging into the results!

PrzemyslawKlys commented 3 years ago

Fixed, please update and test again 0.51.