Add-HostedEmailAccount

Creates a hosted email account and assigns it to a network user account.

Syntax

Add-HostedEmailAccount
   [-LocalAccountName] <String>
   [-EmailAddress] <String>
   [[-Password] <SecureString>]
   [<CommonParameters>]

Description

The Add-HostedEmailAccount cmdlet creates a hosted email account and assigns it to a local user account. A hosted email service provides a hosted email account.

Examples

Example 1: Create a hosted email account

PS C:\> $SecureString_pwd = ConvertTo-SecureString "P@ssW0rD!" -AsPlainText -Force
PS C:\> Add-HostedEmailAccount -LocalAccountName "PattiFuller" -EmailAddresses "PattiFuller@Constoso.com" -Password $SecureString_pwd

The first command creates a secure string password.

The second command creates a hosted email account named PattiFuller@Constoso.com and assigns it to a local user account named PattiFuller, using the password created in the previous command.

Parameters

-EmailAddress

Specifies an email address for a hosted email account. The cmdlet creates a hosted email account that has the email address that you specify.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-LocalAccountName

Specifies the name of a local Active Directory user account. The cmdlet assigns the hosted email account to the local user account that you specify.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies the password, as a secure string, for the hosted email account. To obtain a secure string, use the ConvertTo-SecureStringhttp://go.microsoft.com/fwlink/?LinkID=113291 cmdlet. For more information, type Get-Help ConvertTo-SecureString.

Type:SecureString
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.String,System.String,System.Security.SecureString

LocalAccountName Type: System.String Description: local user name

EmailAddress Type: System.String Description: email address account

Password Type: System.Security.SecureString Description: password for the email account