AsBuiltReport / AsBuiltReport.Microsoft.Windows

Repository for AsBuiltReport Microsoft Windows module
MIT License
29 stars 11 forks source link

Fixed issue with getting local group members if membership contains an entry with an orphaned SID #32

Closed flynngw closed 1 month ago

flynngw commented 1 month ago

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:

rebelinux commented 1 month ago

Your code fix the issue.

Thanks!

image