Hi guys, im stuck with this.
I'm creating a folder for each of my OU then getting the GPO report for each gpo that is linked in my ou then storing that reports to my folder that i created that is named
each ou.
$OUs = Get-ADOrganizationalUnit -Filter 'Name -like "*"'
$directory = foreach($ou in $ous){ new-item -name $ou.name -ItemType directory -path C:\temp\test}
$like = foreach($ou in $ous){Get-GPInheritance -Target $ou}
foreach($pol in $like){if ($pol.path -eq $ou.Name){foreach($link in $pol.GpoLinks){Get-GPOReport -Name $link -ReportType html -path }}}