Add-HostedEmailAccount

Add-HostedEmailAccount

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

Syntax

Parameter Set: Default
Add-HostedEmailAccount [-LocalAccountName] <String> [-EmailAddress] <String> [[-Password] <SecureString> ] [ <CommonParameters>]

Detailed 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.

Parameters

-EmailAddress<String>

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

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-LocalAccountName<String>

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.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Password<SecureString>

Specifies the password, as a secure string, for the hosted email account. To obtain a secure string, use the ConvertTo-SecureString cmdlet. For more information, type Get-Help ConvertTo-SecureString.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • 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

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a hosted email account

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.

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

Get-HostedEmailAccount

Set-HostedEmailAccount

Enable-HostedEmailAccount

Disable-HostedEmailAccount

Remove-HostedEmailAccount

Clear-AssignedHostedEmailAccount