0

Im trying to get all the gpo's linked to an ou for example:

$test = Get-GPInheritance -target "ou=blabla,dc=bla,dc=local" | Select-Object gpolinks

Then when i print out $test i get this

GpoLinks

`--------

{gpo1, gpo2, gpo3}

What i really would like is to strip out the title with the "--" and get a nice list of the gpo's alone. how can it be done? Thanks!

mklement0
  • 382,024
  • 64
  • 607
  • 775
Shahar Weiss
  • 141
  • 1
  • 2
  • 11
  • 1
    `Select-Object gpolinks` -> `Select-Object -Expand gpolinks` or `ForEach-Object gpolinks` – Mathias R. Jessen May 11 '20 at 18:39
  • n short: [`Select-Object`](https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-object) (`select`) returns _a `[pscustomobject]` instance_ that has the _requested properties_ - even when you're only asking for a _single_ property. To get only that property's _value_, use `-ExpandProperty ` instead - see the [linked answer](https://stackoverflow.com/a/48809321/45375) for details and alternatives. – mklement0 May 11 '20 at 19:03

0 Answers0