Closed pogreb closed 5 years ago
Hi @pogreb , the -ShowPlainTextPasswords
parameter of Test-PasswordQuality
cmdlet had been removed in version 3.0 due to some performance optimizations, see the Changelog.
Does the Get-ADReplAccount
cmdlet give you any results?
Could you please just try running this?
$Dict = Get-Content 'C:\DSInternals\PasswordDict1.txt'
Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswords $Dict
Hi Michael! Thanks for the answer.
I'm use DSInternals version 3.3
I changed your request and ran
$DC = "mall-s-dc5" $Domain = "DC=mall, DC=local" $Dict = Get-Content 'C:\DSInternals\PasswordDict1.txt' Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswordsHashes $Dict
In response, again an error on the parameter "WeakPasswords"
I could not find the parameter -WeakPasswords and write -WeakPasswordsHashes
Got an error Origina
Test-PasswordQuality : Не удается привязать параметр "WeakPasswordHashes". Не удается преобразовать значение "ZZZZZZZZZZZZZZZZZZZZ" типа "System.String" в тип "System.Collections.Generic.IDi ctionary
2[System.Byte[],System.String]".
строка:4 знак:102
+ CategoryInfo : InvalidArgument: (:) [Test-PasswordQuality], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,DSInternals.PowerShell.Commands.TestPasswordQualityCommand`
**Translate answer**
Test-PasswordQuality: Cannot bind the "WeakPasswordHashes" parameter. Cannot convert value "ZZZZZZZZZZZZZZZZZZZZ" type "System.String" to type "System.Collections.Generic.IDi
ctionary`2 [System.Byte [], System.String] ".
line: 4 characters: 102
+ CategoryInfo: InvalidArgument: (:) [Test-PasswordQuality], ParameterBindingException
+ FullyQualifiedErrorId: CannotConvertArgumentNoMessage, DSInternals.PowerShell.Commands.TestPasswordQualityCommand
"ZZZZZZZZZZZZZZZZZZZZ" - This is the only password in the file C:\DSInternals\PasswordDict1.txt
Big thanks for the help.
The error you are describing is still from 2.5. Please make sure that you deleted the old version of the module and that you are using 3.3 exclusively.
current version powershell 4.0. Do I need to upgrade powershell to 5 version? Thanks
I meant DSInternals version, not PowerShell version.
Hi, Michael!
I'm run get-module -listAvailable
Script 3.3 DSInternals {ConvertTo-NTHash, ConvertTo-LMHash, Set-SamAccountPasswordHash, ConvertFrom-UnicodePassword...}
After i'm run
$DC = "mall-s-dc5" $Domain = "DC=mall,DC=local" $Dict = Get-Content 'C:\DSInternals\PasswordDict1.txt' Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswordsHashes $Dict
Error original `строка:1 знак:20
Непредвиденная лексема "$Domain" в выражении или операторе.
строка:1 знак:49
Непредвиденная лексема "$Dict" в выражении или операторе.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken`
Error translate `line: 1 character: 20
The unexpected lexeme "$ Domain" in an expression or statement.
line: 1 character: 49
The unexpected lexeme "$ Dict" in an expression or statement.
+ CategoryInfo: ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId: UnexpectedToken`
You either need to only use a single command per line or separate them with a semicolon ; But that is basic PowerShell syntax stuff and has nothing to do with DSInternals.
Hi! Michael, I run script $DC = "mall-s-dc5"; $Domain = "DC=mall, DC=local"; $Dict = Get-Content 'C:\DSInternals\PasswordDict1.txt'; Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswords $Dict
But the execution of the script freezes. If you leave only one password in the dictionary, the script works. Password file size 21mb
For how long does it freeze? Did you give it some time, like at least 10 minutes? Passing such huge arrays of strings is never a good idea in PowerShell.
Why don't you do the following instead of using Get-Content?
$DC = "mall-s-dc5"
$Domain = "DC=mall, DC=local"
$Dict = 'C:\DSInternals\PasswordDict1.txt'
Get-ADReplAccount -All -Server $DC -NamingContext $Domain |
Test-PasswordQuality -WeakPasswordsFile $Dict
Thank you very much, everything works fine. But, in version 2.6. showed with what password from the dictionary there is a coincidence, now there is no
As already said, the -ShowPlainTextPasswords parameter of the Test-PasswordQuality cmdlet had been removed in version 3.0 due to some performance optimizations. It might come back in one of the future versions.
Michael, big thanks! Nice day!!!
Hi! This script work is OK on DSInternal 2.5
$DictFile = "C:\DSInternals\password2.txt" $DC = "ll.local" $Domain = "DC=ll, DC=local" $Dict = Get-Content $DictFile | ConvertTo-NTHashDictionary Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswordHashes $Dict -ShowPlainTextPasswords -IncludeDisabledAccounts $EWB.Saveas('C:\password.txt')
After update DSInternal to 3.2 my script not working I run script$Dict = Get-Content $DictFile $DictFile = C:\DSInternals\PasswordDict1.txt Get-ADReplAccount -All -Server $DC -NamingContext $Domain | Test-PasswordQuality -WeakPasswords $Dict -ShowPlainTextPasswords -IncludeDisabledAccounts
No Error, no results, no end work script Please help me repare work my script/ Thank you!