I'm brand new to PS, and have tried using the various helps for both the Get-ADOrganizationalUnit and Get-GPO cmdlets, but I can't seem to get what I need. I found a script online which (I export to a CSV and…) lists all the OU's in column A, and then the GPO's linked to each of the OU's. However, what I want is just the opposite. I want to get a list of all the policies in column A, and then all the OU's that they're linked to in column B.
The script I was trying is below. I modified it a little to spit out a CSV and only show the "FriendlyGPODisplayName" and OU Name. But I just feel like Get-ADOrganizationalUnit is just not going to be the right cmdlet for what I'm looking for. However, there doesn't seem to be any "Get-GPLink" type cmdlets (only "set, remove, and new) which sounds like it would work perfect if it existed.
http://powershell.com/cs/forums/p/13834/25908.aspx
Thanks.