0

I would like to get a list from the Domain server of the AD groups being used for a specific application. The AD group contain an acronym for the application. For example, I would like to get all groups used for the general ledger application (AD groups contain "GL").

If I could do it with "net group /domain" and use wildcards like "gl", it might work, but I don't know if that can be down.

Or, with a Powershell script.

Thanks.

FPV
  • 1

1 Answers1

0

The following will obtain all of the Groups in your domain with "GL" in the name.

Get-ADGroup -filter 'name -like "*GL*"' -searchscope Subtree

There are many more options for Get-ADGroup and the filters are a bit tedious to learn and use.

However, the filters use almost the same syntax as PowerShell does natively (filter belons to the AD provider) so it's not too bad if you know how to use "Where-Object" or "IF" statements etc.

"-eq" "-like" etc and there are combining forms for "-and" "-or"

You can do "Get-Help -full Get-ADGroup" to see the full help or use the following to set just the filter parameter (less screen clutter):

Get-Help -parameter filter Get-ADGroup
HerbM
  • 101
  • 3
  • Herb, When I ran your script, I got "Get-ADGroup : The term 'Get-ADGroup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-ADGroup -filter 'name -like "*wcis*"' -searchscope Subtree + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-ADGroup:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException " – FPV Jul 26 '19 at 23:58
  • My PowerShell is 5.1 on Windows 7 but I might have loaded the RSAT (Remote Server Admin Tools) to get those CmdLets. – HerbM Jul 27 '19 at 01:13