Getting started at a large environment, and checking GPO information.
I have a script that gets all GPO’s (there are alot…) the grabs name, domain, ID and the SOMPath.
I have a group of GPO’s that are linked to multiple OU’s. which is returned by $gporeport.gpo.linksto.SOMPath. My CSV returns System.Object.
I am somewhat stumped by how I can list out the 2 or 3 OU paths. I cant figure out how to test for multiple values, or it may that its late…
Foreach($sysvolGuid in $sysvolGuids)
{
$GPO = $null
$gporeport = $null
#Write-Host $sysvolGuid
$GPO = get-gpo -Domain $Domain -guid $sysvolGuid
[xml]$gporeport = get-gporeport -Domain $Domain -Guid $sysvolGuid -ReportType xml
$obj = [pscustomobject]@{'GPOName'=$GPO.DisplayName
'Domain'=$GPO.DomainName
'ID'=$GPO.ID
'OU Link Path'=$gporeport.gpo.linksto.SOMPath}
Write-Output $obj
export-csv gpoinfo.csv -InputObject $obj -Append -NoTypeInformation
}#Foreach