What containers is a GPO linked to?

Get the GPO
$g = Get-GPO -Name Name_Of_The_Gpo

Get the GPO ID as a string, add an asterix at the start and at the end of the string
$gid = "*" + $g.id + "*"

Find all the containers a GPO is linked to using Microsoft ActiveDirectory module
Get-ADObject -Properties gplink -Server your.windows.domain.com -Filter {gplink -like $gid} | select -ExpandProperty distinguishedname

Find all the containers a GPO is linked to using Quest Active Directory Commandlets
Get-QADObject -IncludedProperties gplink -Service cb.ds.mfcr.cz -SearchAttributes @{gpLink=$gid} | select -expand dn

Advertisements

Tagged: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

smsagent

Tips, tricks and time-savers for the Windows and ConfigMgr administrator

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?

%d bloggers like this: