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 from Jaap in another post ( http://powershell.com/cs/forums/p/13834/25908.aspx ) 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.
Column A (GPO's) Column B (Linked to...)
IESettingsGPO1 LondonOU, ChicagoOU, AtlantaUsersOU
RemoteUsersGPO2 ChicagoOU
GPO3 domainlevelOU
etc...
On the PS.org forum, I was directed to the Get-GPLink and SDM-GP cmdlets, but I'm not sure if those produce the output I need. So far, I can use the cmdlet below to get a list of all the GPO's, but I don't know how to pipe that over to some other command to be able to get the links to each of the GPO's
get-gpo -All | Select-Object displayname | format-list
Thanks.