dakhama-mehdi / Modern_ActiveDirectory

Modern Active Directory
MIT License
62 stars 11 forks source link

Crash on too many computer objects #9

Closed dbowman410 closed 1 year ago

dbowman410 commented 1 year ago

Getting this error:

Working on Computers Report...
Get-ADComputer : The server has returned the following error: invalid enumeration context.
At C:\Program Files\WindowsPowerShell\Modules\ModernActiveDirectory\1.4.1\ModernActiveDirectory.psm1:918 char:1
+ Get-ADComputer -LDAPFilter "(!(userAccountControl:1.2.840.113556.1.4. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ADComputer], ADException
    + FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.GetADComputer

We have 259 computers in AD. I fixed the issue by adding "-ResultPageSize 400" to Get-ADComputer, but that is not a general fix for everyone.

Also, you have a misspelled "computers" in there, "Computesr".

dakhama-mehdi commented 1 year ago

Hi dbowman410,

Thank you for reply, your error is random, may be related to an enumeration restriction in AD with your EDR, or the AD module is incorrectly installed, have you tried on another server? i'm update wa new version 1.5.0, that i have fix all that, also i have added the GMSA report now. you can try it and tell me. The module work fine for me on all my client that have more 10K computers.

can you try with get-admodernreport -illimited.