Forum Discussion
Baron164
Sep 08, 2022Brass Contributor
Need help exporting list of enabled group members
So I have this simple one line that exports the members of a group. Get-ADgroupMember GroupName -Recursive | select Name | Sort-Object -Property Name | export-csv -Path \\domain.local\share...
Sep 09, 2022
Get-ADGroupMember group1 -Recursive | Get-ADuser | Select-Object Name, Enabled | Export-Csv -Path c:\temp\users.csv -NoTypeInformation -Encoding UTF8 -Delimiter ';'
This and filter in Excel?
Baron164
Sep 09, 2022Brass Contributor
If the other engineer I'm working with can re-write his script to only pull the enabled users from that, then that might be good enough.
- Sep 09, 2022.... 😄 Didn't expect that....
- Baron164Sep 09, 2022Brass ContributorOk, so this is interesting/annoying, I tried running the commands from a different machine and if I run them from a normal PowerShell window, the "enabled" column is blank except for the two users I've been seeing. Whom, after checking appear to have their object Security Inheritance disabled, where the other users all appear to have it enabled. If I run the same commands from a Administrative PowerShell session the enabled column is populated for each users.
Now going back, my original command actually works, if I run it from an Administrative Session. So now I feel like an idiot. - Sep 09, 2022Let us know 🙂