ad-password-protection
ad-password-protection copied to clipboard
AggregateExceptions are hiding the real error in PowerShell output
When I try to use Powershell to add a custom BannedWord or CompromisedPassword, I get the following error:
PS C:\Windows\system32> Add-BannedWord -Value "glass" Add-BannedWord : One or more errors occurred. At line:1 char:1
- Add-BannedWord -Value "glass"
-
+ CategoryInfo : NotSpecified: (:) [Add-BannedWord], AggregateException + FullyQualifiedErrorId : System.AggregateException,Lithnet.ActiveDirectory.PasswordProtection.PowerShell.AddBannedWord
PS C:\Windows\system32> Add-CompromisedPassword -Value "glass" Add-CompromisedPassword : One or more errors occurred. At line:1 char:1
- Add-CompromisedPassword -Value "glass"
-
+ CategoryInfo : NotSpecified: (:) [Add-CompromisedPassword], AggregateException + FullyQualifiedErrorId : System.AggregateException,Lithnet.ActiveDirectory.PasswordProtection.PowerShell.AddCompromisedPassword
Thank you!
It appears the command doesn't use the default store, as mentioned in the Open-Store Wiki, and you have to run Open-Store first.
Hi Aaron,
Can you send me the result of running the following command immediately after getting that error.
$error[0].Exception.ToString()
Looks like it's my bad... When I do open-store I went right to the file system location and didn't use the share. The share was setup as read-only. Thank you for the command to show the error message: System.AggregateException: One or more errors occurred. ---> System.UnauthorizedAccessException: Access to the path '\servername\lpp$\v3\w\AE2C.db.bin' is denied.
Sorry for the bogus issue! After fixing the share permissions, it is working as expected.
That's ok. I'll need to fix the error reporting to make it more clear what was going on.