Add-MailContact
SYNOPSIS
Create a new mail contact in Exchange Online.
SYNTAX
Add-MailContact [-FirstName] <String> [-LastName] <String> [-Email] <String> [-Task] <Int32>
[<CommonParameters>]
DESCRIPTION
The `Add-MailContact` function creates a new mail contact in Exchange Online. It generates a unique contact name, assigns an external email address, and hides the contact from address lists. A custom attribute is added to include metadata such as the task number and creation date.
EXAMPLES
EXAMPLE 1
Add-MailContact -FirstName "John" -LastName "Doe" -Email "[email protected]" -Task 12345
Creates a new mail contact for John Doe with the email address `john.doe@example.com` and associates it with task number 12345.
PARAMETERS
-FirstName
The first name of the mail contact.
Type: String
Parameter Sets: (All)
Aliases: FN, Voornaam
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-LastName
The last name of the mail contact.
Type: String
Parameter Sets: (All)
Aliases: LN, Familienaam
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The external email address of the mail contact.
Type: String
Parameter Sets: (All)
Aliases: E, EmailAddress, EmailAdres, ExternalEmailAddress, Mail
Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Task
A task number associated with the creation of the mail contact.
Type: Int32
Parameter Sets: (All)
Aliases: T, TaskNumber, TaskNummer
Required: True
Position: 4
Default value: 0
Accept pipeline input: True (ByPropertyName)
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.