Sorry, search feature is not supported in Internet Explorer 11

E-mail addresses

The following code sample modifies e-mail addresses of a mail-enabled group.


# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the group
$groupDN = "CN=MyGroup,CN=Users,DC=example,DC=com"
$group = $admService.OpenObject("Adaxes://$groupDN", $NULL, $NULL, 0)

# Create an instance of the 'AdmExchangeMailGroupParameters' class
$groupParams = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailGroupParameters"

# Do not update e-mail addresses based on e-mail address policy automatically
$groupParams.EmailAddressPolicyEnabled = $False

$emailAddresses = $groupParams.EmailAddresses

# Create a new SMTP address
$emailAddress = $emailAddresses.CreateAddress("ADM_EXCHANGE_ADDRTYPE_SMTP", $null)
$emailAddress.Address = ""
$emailAddress.IsPrimary = $True

# Add new e-mail address to the existing list
$emailAddresses.Add("ADS_PROPERTY_APPEND", $emailAddress)
$emailAddresses.OverrideOldValues = $False
$groupParams.EmailAddresses = $emailAddresses

# Save changes
$group.SetMailParameters($groupParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")

See also