Remove-DLMember
SYNOPSIS
Remove a member from a distribution list (DL).
SYNTAX
Remove-DLMember [-Identity] <String> [-Member] <String[]> [[-Task] <Int32>] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
The `Remove-DLMember` function removes one or more members from a specified distribution list (DL). It connects to Exchange Online, validates the DL, and removes the specified members. The function supports confirmation prompts and task logging.
EXAMPLES
EXAMPLE 1
Remove-DLMember -Identity "TeamDL" -Member @("[email protected]", "[email protected]") -Task 12345
Removes the specified members from the distribution list `TeamDL` and logs the action with task number 12345.
EXAMPLE 2
Remove-DLMember -Identity "ProjectDL" -Member @("[email protected]")
Removes the specified member from the distribution list `ProjectDL`.
PARAMETERS
-Identity
The identity of the distribution list from which the member(s) will be removed (e.g., DisplayName or Alias).
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Member
An array of members to be removed from the specified distribution list.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Task
The task number associated with the removal of the member(s), used for logging purposes.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 0
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.