EvotecIT / Testimo

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

Testimo failed run - Get-WinADForestDetails : Cannot index into a null array. #139

Closed saliumaama closed 2 years ago

saliumaama commented 2 years ago

I'm having this error message when I run Invoke-Testimo. Not sure why. Is there anything I'm doing wrong ? Is Testimo supposed to be run ONLY on domain controllers ?

[i][Testimo] Version [Informative] [Current: 0.0.72] [i][Testimo] Using configuration defaults [Informative] [No configuration provided by user] Get-WinADForestDetails : Cannot index into a null array. At C:\Program Files\WindowsPowerShell\Modules\Testimo\0.0.72\Testimo.psm1:6298 char:22

... stDetails = Get-WinADForestDetails -WarningVariable ForestWarning -Wa ...


CategoryInfo : InvalidOperation: (:) [Get-WinADForestDetails], RuntimeException
FullyQualifiedErrorId : NullArray,Get-WinADForestDetails
image

![image](https://user-images.githubusercontent.com/91435738/134823738-5007cc9e-efaa-47ab-ae84-aa77f96bdc87.png)
saliumaama commented 2 years ago

In response to the request "Please check: Get-ADForest, Get-ADDomain - does that work properly?"

Yes, both commands run successfully with no issues on the same Windows 10 that I run the Invoke-Testimo from.

PrzemyslawKlys commented 2 years ago

And when you run Get-WinADForestDetails do you get an error?

saliumaama commented 2 years ago

This is what I get. The domain shown is our child domain that longer exist. It was set up years ago only as a test. Is there a way I can force the Testimo to ignore that domain ?

image

PrzemyslawKlys commented 2 years ago

I'll try to fix it, so it skips it automatically down domains... but - you should remove it a long time ago - as this is hugely affecting your AD.

saliumaama commented 2 years ago

ok, looking forward to the fix. Agreed, dormant domain should be removed.

PrzemyslawKlys commented 2 years ago

Install-Module PSSharedGoods -Force -Verbose

It should fix your issue. Please let me know

saliumaama commented 2 years ago

still getting some errors. the verbose is from the command you asked me to run prior to invoke-testimo command

image

PrzemyslawKlys commented 2 years ago

If you're doing it all in one session you need do Import-Module PSSharedGoods -Force first

When you open up PowerShell and you have some modules installed they often pre-import themselves. So close PowerShell, retry Invoke-Testimo.

Also Get-Module -list PSSharedGoods because the not enough memory looks weird.

saliumaama commented 2 years ago

I closed /Open PS as you suggested and so far it appears to be running good. I believe the error I'm seeing are due to those dormant domains we talked about. Script is still as of this message

image

PrzemyslawKlys commented 2 years ago

You should fix your issue first! It's critical for your domain.