Functions/HealthCheck/UserGroups/Get-AMHCDisabledUserGroup.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Get-AMHCDisabledUserGroup {
    <#
        .SYNOPSIS
            Disabled User Groups
 
        .DESCRIPTION
            User groups that are disabled
 
        .PARAMETER UserGroups
            The user groups to perform health check against
    #>

    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [AllowNull()]
        $UserGroups
    )

    foreach ($userGroup in ($UserGroups | Where-Object {-not $_.Enabled})) {
        [AMConstructHealthCheckItem]::New($userGroup, "Disabled")
    }
}