Test-MtAdOuEmptyCount
SYNOPSIS
Counts the number of empty Organizational Units (OUs without users, groups, or computers) in Active Directory.
SYNTAX
Test-MtAdOuEmptyCount [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
This test identifies OUs that do not contain any user, group, or computer objects. Empty OUs may be remnants of reorganizations, abandoned projects, or placeholders that were never used. While empty OUs don't pose a direct security risk, they clutter the directory and can cause confusion. Regular cleanup of empty OUs helps maintain directory hygiene.
EXAMPLES
EXAMPLE 1
Test-MtAdOuEmptyCount
Returns $true if OU data is accessible, $false otherwise. The test result includes the count of empty OUs.
PARAMETERS
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.