adrecon / ADRecon

ADRecon is a tool which gathers information about the Active Directory and generates a report which can provide a holistic picture of the current state of the target AD environment.
GNU Affero General Public License v3.0
670 stars 98 forks source link

Lots of PowerShell errors when generating a report #27

Open benji1000 opened 6 months ago

benji1000 commented 6 months ago

Hello,

when generating a report, I get tons of PowerShell errors. The Excel file is generated and usable, but I don't know what these errors mean, and if they are preventing something from being generated in the report. I also think they should be eliminated for the sake of not having erros when running the tool 😊

Here are a few of these errors. My system is in French, so I did my best to translate them.

Value doesn't belong in the expected range.
At D:\tools\adrecon\ADRecon.ps1:5509 : 17
+ ...             $worksheet.Range($ObjValues[$i]).FormatConditions.Add([Mi ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException
Invalid index. (HRESULT exception: 0x8002000B (DISP_E_BADINDEX))
At D:\tools\adrecon\ADRecon.ps1:5514 : 17
+ ...             $worksheet.Range($_).FormatConditions.Item(1).StopIfTrue  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Cannot find an overload for « Style » and the number of arguments: « 1 »
At D:\tools\adrecon\ADRecon.ps1:4960 : 5
+     $worksheet.Cells.Item($row,$column).Style = "Heading 2"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : RuntimeException
HRESULT exception: 0x800A03EC
At D:\tools\adrecon\ADRecon.ps1:5914 : 17
+ ...             Get-ADRExcelChart -ChartType "xlPie" -ChartLayout 3 -Char ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

You can get here a ZIP file containing the full error log, the CSV files, and the generated Excel file: ADRecon.zip

This was run on a testing environment, but the same errors happen on real environments.

Could you look into it and tell me why these errors occur, or what can I do to help you fix them?