Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (21 sloc) 887 Bytes
$aOutput = @();
$aDisabledGpos = Get-GPO -All | Where-Object { $_.GpoStatus -eq 'AllSettingsDisabled' };
foreach ($oGpo in $aDisabledGpos) {
$oOutput = New-Object System.Object;
$oOutput | Add-Member -type NoteProperty -Name 'Status' -Value 'Disabled';
$oOutput | Add-Member -type NoteProperty -Name 'Name' -Value $oGpo.DisplayName;
$aOutput += $oOutput;
}##endforeach
$aAllGpos = Get-Gpo -All;
$aUnlinkedGpos = @();
foreach ($oGpo in $aAllGpos) {
[xml]$oGpoReport = Get-GPOReport -Guid $oGpo.ID -ReportType xml;
if (!(Test-Member $oGpoReport.GPO LinksTo)) {
$oOutput = New-Object System.Object;
$oOutput | Add-Member -type NoteProperty -Name 'Status' -Value 'Unlinked';
$oOutput | Add-Member -type NoteProperty -Name 'Name' -Value $oGpo.DisplayName;
$aOutput += $oOutput;
}##endif
}##endforeach
$aOutput.Count
$aOutput | Sort-Object Name | Format-Table -AutoSize
You can’t perform that action at this time.