Skip to content

Get-SQLServerLoginDefaultPw Fails with Instances where Multiple Credentials are Present #42

Open
@fullmetalcache

Description

@fullmetalcache

It appears that when running Get-SQLServerLoginDefaultPw, errors arise in cases where instances that are found that have multiple sets of credentials that need to be tried. For instance. SQLEXPRESS instances have four sets of credentials to try. The issue is that these sets of values come out of $TblResultsTemp.username and $TblResultsTemp.password as arrays and then are assigned to $CurrentUsername and $CurrentPassword, respectively. The $CurrentUsername and $CurrentPassword variables are then used as strings even though they are actually arrays at this point.

The fix to this is just to unroll the values and test them pairwise one at a time. I have a quick fix for this and will try to get a PR done if nobody else hops on it first.

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions