# New GPOs: how to show what they are linked to

**URL:** <https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389>\
**Category:** PowerShell Help\
**Created:** [September 27, 2018, 5:53pm UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389 "2018-09-27T17:53:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-taylor](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-taylor/32/1015_2.png) [@jeff-taylor](https://forums.powershell.org/u/jeff-taylor)\
**Post date:** [September 27, 2018, 5:53pm UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389/1 "2018-09-27T17:53:38Z")

</div>

I created a bunch of GPOs and have enumerated them with this code:

```
Get-GPO -Server corp.com -All | ? {$_.DisplayName -match "DEV-"} | select DisplayName,Description
```

…but how can I also show the GPO’s they are now linked to?

I looked at _GPLink_ but nothing useful there, I think.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [September 28, 2018, 1:01am UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389/2 "2018-09-28T01:01:53Z")

</div>

I searched for “powershell get gpo link status” and I found this link:

[https://social.technet.microsoft.com/Forums/windowsserver/en-US/de1431b6-190c-4779-8b44-b2c33b22fc15/powershell-determining-if-a-gpo-is-linked?forum=winserverpowershell](https://social.technet.microsoft.com/Forums/windowsserver/en-US/de1431b6-190c-4779-8b44-b2c33b22fc15/powershell-determining-if-a-gpo-is-linked?forum=winserverpowershell)

---

<div class="post-metadata">

**Author:** ![jeff-taylor](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-taylor/32/1015_2.png) [@jeff-taylor](https://forums.powershell.org/u/jeff-taylor)\
**Post date:** [September 28, 2018, 11:51am UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389/3 "2018-09-28T11:51:34Z")

</div>

seems promising but really couldn’t get it to run with out errors. I’ve tried replacing certain values with those in my environment but missing something. I’d be seeking all GPOs with the “DEV-” in the name and linked.

```
Function Get-AllGPO
{
	Get-GPOReport -all -ReportType xml | %{
		([xml]$_).gpo | select name,@{n=" **SOMName**";e={$_.LinksTo | % {$_.SOMName}}},@{n="SOMPath";e={$_.LinksTo | %{$_.SOMPath}}}
	}
}

#Get Gpo with name Turn* and display what OU is linked.
Get-AllGPO | ? {$_.Name -match " **DEV-**"} | %{$_.SomName}
```

…not sure why the author would use a pipeline variable like this $\_.SOMName however…

---

<div class="post-metadata">

**Author:** ![sanchez](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sanchez](https://forums.powershell.org/u/sanchez)\
**Post date:** [September 28, 2018, 1:40pm UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389/4 "2018-09-28T13:40:52Z")

</div>

> **[Dude, where’s my GPO? Using PowerShell to find all of your Group Policy links.](https://docs.microsoft.com/en-us/archive/blogs/ashleymcglone/dude-wheres-my-gpo-using-powershell-to-find-all-of-your-group-policy-links)**

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/new-gpos-how-to-show-what-they-are-linked-to/11389/5 "2024-05-16T20:34:20Z")

</div>


