MichaelGrafnetter / DSInternals

Directory Services Internals (DSInternals) PowerShell Module and Framework
https://www.dsinternals.com
MIT License
1.62k stars 250 forks source link

PWDump custom view issue when run under SYSTEM account #141

Open DiPersiaTech opened 2 years ago

DiPersiaTech commented 2 years ago

When running

Get-ADDBAccount -All -DBPath "$Path\Active Directory\ntds.dit" -BootKey $key | Format-Custom -View PWDump

under the system account context (Which our automation system does), the output is broken into multiple lines. For example -

User:2677:NO LM-HASH**********************:1111111111111111111111111:::

Where output should show as a single line - User2677:NO LM-HASH**********************:1111111111111111111111111::::

Can replicate this by starting Powershell using PSEXEC as the system.

MichaelGrafnetter commented 2 years ago

Hello @DiPersiaTech , line wrapping depends solely on the configuration of your terminal window, which is profile-specific. You should be able to bypass it by piping the output to the Out-File cmdlet.

DiPersiaTech commented 2 years ago

@MichaelGrafnetter thanks for the response. Same behavior actually, regardless of screen or file. I assumed the custom view had something to do with it and running under system. This is with the out-file

Get-ADDBAccount -All -DBPath "$Path\Active Directory\ntds.dit" -BootKey $key | Format-Custom -View PWDump | Out-File $Path\dump.txt -Force -Encoding ascii

MichaelGrafnetter commented 2 years ago

Interesting. Looking into the source file, there is only a space.

DiPersiaTech commented 2 years ago

I concur. That is weird. If/when you get time, can you try to replicate with psexec just so I can see if it's me or. . .?