Skip to content

Get-ADLockoutStatus

SYNOPSIS

Retrieves the lockout status of an Active Directory user.

SYNTAX

Get-ADLockoutStatus [[-Identity] <Object>] [[-DomainController] <String[]>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The `Get-ADLockoutStatus` function retrieves detailed lockout information for a specified Active Directory user. It queries domain controllers to gather data such as lockout status, bad password attempts, last logon, and password last set details.

EXAMPLES

EXAMPLE 1

Get-ADLockoutStatus -Identity "jdoe"

Retrieves the lockout status for the user "jdoe" across all domain controllers.

EXAMPLE 2

Get-ADLockoutStatus -Identity "jdoe" -DomainController "DC01"

Retrieves the lockout status for the user "jdoe" from the specified domain controller "DC01."

PARAMETERS

-Identity

The identity of the Active Directory user to query. Defaults to the current username if not specified.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: $env:USERNAME
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-DomainController

A list of domain controllers to query. Defaults to all enabled domain controllers.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: *
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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.

INPUTS

OUTPUTS

NOTES