Fixed issue with getting local group members being blank if any member of that group contains an orphaned SID. Fix #31
Description
Added a function called Get-LocalGroupMembership to get local group members that does not have an issue with group members with an orphaned SID.
The original author of the Get-LocalGroupMembership function is Boe Prox: https://github.com/proxb/PowerShell_Scripts/blob/master/Get-LocalGroupMembership.ps1
The function has been modified slightly so that the output is compatible with the native Get-LocalGroupMember (to prevent re-work)
This has been tested on Powershell 5.1 and Powershell 7.4.2
This has also been tested against the following Windows Operating Systems:
Windows Server 2008 R2
Windows Server 2016
Windows Server 2019
Windows Server 2022
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Fixed issue with getting local group members being blank if any member of that group contains an orphaned SID. Fix #31
Description
Added a function called Get-LocalGroupMembership to get local group members that does not have an issue with group members with an orphaned SID. The original author of the Get-LocalGroupMembership function is Boe Prox: https://github.com/proxb/PowerShell_Scripts/blob/master/Get-LocalGroupMembership.ps1 The function has been modified slightly so that the output is compatible with the native Get-LocalGroupMember (to prevent re-work)
Related Issue
https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows/issues/31
Motivation and Context
Solves issue: https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows/issues/31 Without this fix, if a member of any of your local groups SID could not be resolved, the output for that group membership would be blank.
How Has This Been Tested?
This has been tested on Powershell 5.1 and Powershell 7.4.2 This has also been tested against the following Windows Operating Systems: Windows Server 2008 R2 Windows Server 2016 Windows Server 2019 Windows Server 2022
Types of changes
Checklist: