Skip to content

Get-ADGroupMemberHistory

SYNOPSIS

Retrieves the membership history of an Active Directory group.

SYNTAX

Get-ADGroupMemberHistory [-Identity] <String[]> [-IncludeDeletedObjects] [[-Server] <String>]
 [<CommonParameters>]

DESCRIPTION

The `Get-ADGroupMemberHistory` function retrieves the membership history of an Active Directory group, including details about when members were added, changed, or deleted. It can optionally include deleted objects in the output.

EXAMPLES

EXAMPLE 1

Get-ADGroupMemberHistory -Identity "GroupName"

Retrieves the membership history of the group "GroupName."

EXAMPLE 2

Get-ADGroupMemberHistory -Identity @("GroupName1", "GroupName2") -IncludeDeletedObjects

Retrieves the membership history of the specified groups, including deleted objects.

PARAMETERS

-Identity

The identity of the Active Directory group(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

-IncludeDeletedObjects

A switch parameter that, when specified, includes deleted objects in the membership history.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: False
Accept pipeline input: False
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