Forum Discussion
Baron164
Jul 13, 2022Brass Contributor
How can I list only groups with a gidNumber?
I need to export a list of ad groups and their gidNumber. This is what I have so far. My issue is that this also gives me groups without gidNumbers and I don't want those. How can I filter out groups...
- Jul 13, 2022
Hi
You can update the filter to be as the following
Get-ADGroup -Filter "gidNUmber -ge 0" -Property gidNUmber | select Name, gidNumber | Sort-Object -Property gidNumber | export-csv -Path C:\Labs\exportgroups.csv -NoTypeInformationRead more about filters over here
farismalaeb
Jul 13, 2022Iron Contributor
Hi
You can update the filter to be as the following
Get-ADGroup -Filter "gidNUmber -ge 0" -Property gidNUmber | select Name, gidNumber | Sort-Object -Property gidNumber | export-csv -Path C:\Labs\exportgroups.csv -NoTypeInformation
Read more about filters over here