Set-PrimaryEmailAddress cmdlet changes current primary address to another one. 

This cmdlet supports risk-mitigation parameters.

Input parameters

#
Parameter
Type

Mandatory (R/O)

Description
Restrictions/Valid Values
1 Authentication Information (all parameters)  
2

Address

(aliases: EmailAddress)

string R New primary Email address New address must exist in the list of Email addresses
3

Identity

(aliases: GUID, DistinguishedName)

ADObjectIDParameter
R

A property, that is used for managing addresses of mail-enabled Š¾bjects:

  • MS Exchange mailbox
  • OWA-only mailbox
  • POP/IMAP mailbox
  • Resource mailbox
  • MS Exchange distribution list
  • Public folder 

Value of one of these parameters can be used as Identity:

#ParameterDescription
1 GUID Globally Unique Identifier (ObjectGuid)
2 DistinguishedName Unique name of the object in Active Directory

Output parameters

No parameters

Examples of using Set-PrimaryEmailAddress cmdlet

Set-PrimaryEmailAddress -Identity 36082eb0-1011-4f22-aa98-9139ddbd31b3 -EmailAddress "john.doe@accountname.hostpilot.com"