Skip to content

Get-ADUserMemberOfHistory

SYNOPSIS

Retrieves the membership history of an Active Directory user.

SYNTAX

Get-ADUserMemberOfHistory [-Identity] <String[]> [[-Server] <String>] [<CommonParameters>]

DESCRIPTION

The `Get-ADUserMemberOfHistory` function retrieves the membership history of an Active Directory user. It includes details about when the user was added to or removed from groups, as well as the current membership status.

EXAMPLES

EXAMPLE 1

Get-ADUserMemberOfHistory -Identity "jdoe"

Retrieves the membership history of the user "jdoe."

EXAMPLE 2

Get-ADUserMemberOfHistory -Identity @("jdoe", "asmith") -Server "DC01"

Retrieves the membership history of the specified users by querying the domain controller "DC01."

PARAMETERS

-Identity

The identity of the Active Directory user(s) to query (e.g., DistinguishedName or Name).

Type: String[]
Parameter Sets: (All)
Aliases: DistinguishedName, Name

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Server

The domain controller to query for Active Directory information. Defaults to the PDC Emulator of the current domain.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: (Get-ADDomain -Server ($env:USERDNSDOMAIN) -ErrorAction SilentlyContinue | Select-Object -ExpandProperty 'PDCEmulator')
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