DSInternals icon indicating copy to clipboard operation
DSInternals copied to clipboard

Memory consumption when running Get-ADDBAccount command

Open omachugh opened this issue 1 year ago • 1 comments

Hi

Using DSInternals PS Module version 4.9, seeing excessive memory consumption when running the following PS command

Get-ADDBAccount -All -DBPath $NTDSPATH -BootKey $key

To get halfway through c100k accounts is consuming about 6GB of memory.

Thx

omachugh avatar Dec 07 '23 14:12 omachugh

Hello @omachugh, are you saving the output of Get-ADDBAccount to a variable, or are you only processing the results through the pipeline? How large is your ntds.dit file? In environments with Credential Roaming and/or Windows Hello for Business, objects consuming 10s or 100s of KBs are quite common. And deserializing the data from DB into .NET objects also takes its toll. In my performace tests, the .NET garbage collector seemed to do its job during pipeline processing and I have not spotted any memory leaks in the interop libraries from Microsoft. I am working on a feature where you could select what account attributes to fetch. That should increase the performance on large AD databases.

MichaelGrafnetter avatar Dec 08 '23 11:12 MichaelGrafnetter