Solved

Retrieve GPO using Security Filtering Group via Powershell or Any Script

Posted on 2016-08-15
1
133 Views
Last Modified: 2016-08-17
Hello there,

We have a huge environment with tons of GPOs and would like to retrieve a GPO where security filtering (domain local) group is equal to "GROUP_A". What is the best way to do this?

I tried
$GPOs = Get-GPO -All -domain mycompany.com
Get-GPPermissions -domain mycompany.com -GUID. $GPO.Id -TargetName "MYCOMPANY\Group_A" -TargetType Group -ErrorAction SilentlyContinue

and it does not retrieve anything.

Any help would be greatly appreciated! Thanks!!
0
Comment
Question by:IT_Admin XXXX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 41756721
You would have to loop through the GPOs to retrieve the permissions for each.  Try something like the following:
$GPOs = Get-GPO -All -domain mycompany.com
foreach ( $GPO in $GPOs)
{
Get-GPPermissions -domain mycompany.com -GUID $GPO.Id -TargetName "MYCOMPANY\Group_A" -TargetType Group -ErrorAction SilentlyContinue
}

Open in new window

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Powershell script include embedded images 10 47
global Variable - 2 functions in powershell 1 22
Powershell Split 18 29
PowerShell: ForEach-Object Export to CSV 4 46
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question