Today I will go a bit further and find the nested members from the Active Directory.
Get-LocalGroupAllMembers
The following scripts query a localgroup on the localhost or a remote computer, and gather all the local and domain members (direct and nested).
By Default, if you do not specify any parameter, the function will query the Localhost and the Localgroup "Administrators".
Dot Sourcing
Once your Powershell is launched you can load the function using the Dot Sourcing method:. ./Get-LocalGroupAllMembers.ps1
Usage
Get-LocalGroupAllMembers -ComputerName SERVER01 -GroupName "Administrators"
Is there any way to get the samaccountname attribute returned for all results as well?
ReplyDelete