Remove-MsolDomain

Removes a domain from Azure Active Directory.

Syntax

Remove-MsolDomain -DomainName <String> [-Force] [-TenantId <Guid>] [<CommonParameters>]

Description

The Remove-MsolDomain cmdlet is used to delete a domain from Azure Active Directory.
The domain being deleted must be empty.
There cannot be any users or groups with email addresses in this domain.

Examples

Example 1: Remove a domain

PS C:\> Remove-MsolDomain -DomainName "contoso.com" -Force
This command attempts to remove the domain contoso.com without prompting you for confirmation. This operation fails if there are any users or groups that reference the domain.

Parameters

-DomainName

Specifies the fully qualified domain name (FQDN) of the domain to remove.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)

-Force

Indicates that this cmdlet does not prompt you for confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False

-TenantId

Specifies the unique ID of the tenant on which to perform the operation.
The default value is the tenant of the current user.
This parameter applies only to partner users.


Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)