# encoding: ascii
# api: powershell
# title: 
# description: Function to find organizational units linked to a given GPO
# version: 0.1
# type: function
# license: CC0
# function: Get-GPOLinkedOrganizationalUnits
# x-poshcode-id: 6109
# x-archived: 2016-03-18T21:17:08
#
#
<#
.EXAMPLE  
    Get-GPO -Name TestOU | Get-GPOLinkedOrganizationalUnits
#>
Function Get-GPOLinkedOrganizationalUnits {
    param(
        [Parameter(ValueFromPipeline=$true, Mandatory=$true)][Microsoft.GroupPolicy.Gpo]$GPO
    )

    Get-ADOrganizationalUnit -Filter { LinkedGroupPolicyObjects -eq $gpo.Path }
}
