[BUG] Get-LocalGroupMember and unresolved SID throws error
If there is an unresolved SID in a local group the cmdlet Get-LocalGroupMember (and maybe others) throws and error.
Get-LocalGroupMember : Failed to compare two elements in the array.
At line:1 char:1
+ Get-LocalGroupMember -Group 'RDS Endpoint Servers'
+ CategoryInfo : NotSpecified: (:) [Get-LocalGroupMember], InvalidOperationException
+ FullyQualifiedErrorId : An unspecified error occurred.,Microsoft.PowerShell.Commands.GetLocalGroupMemberCommand
If the SID is removed, the cmdlet once again works as expected.
Russell Roefer commented
I agree that the candler should work either way, but a workaround is to use the members property of Get-LocalGroup