Skip to content

Remove-DL

SYNOPSIS

Remove a distribution list (DL) from Exchange Online.

SYNTAX

Remove-DL [-Identity] <String> [[-Task] <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The `Remove-DL` function removes a specified distribution list (DL) from Exchange Online. Before removal, it exports the members of the DL to a CSV file for logging purposes. The function supports confirmation prompts and integrates with Exchange Online authentication.

EXAMPLES

EXAMPLE 1

Remove-DL -Identity "TeamDL" -Task 12345

Removes the distribution list `TeamDL` and logs the action with task number 12345.

EXAMPLE 2

Remove-DL -Identity "ProjectDL"

Removes the distribution list `ProjectDL` without specifying a task number.

PARAMETERS

-Identity

The identity of the distribution list to 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

-Task

The task number associated with the removal of the distribution list, used for logging purposes.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
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.

INPUTS

OUTPUTS

NOTES