IAdmExchangeMailboxRights2

The IAdmExchangeMailboxRights2 interface extends the IAdmExchangeMailboxRights interface with the ability to manage auto-mapping and access rights for Exchange mailbox trustees.

Inheritance: IAdmExchangeMailboxRights

To use the methods provided by this interface, retrieve Exchange properties of an object using method IAdmExchangeMailParametersOps2::GetMailParameters with the props parameter set to ADM_GET_EXCHANGE_PARAMS_FLAGS_NONE.

Methods

Details

GetAutoMappingFor()

Returns a value indicating the auto-mapping state for the specified object.

ADM_EXCHANGE_AUTOMAPINGSTATE_ENUM GetAutoMappingFor(IAdmObjectReference object)

SetAutoMappingFor()

Enables or disables auto-mapping for the specified object.

void SetAutoMappingFor(IAdmObjectReference object, bool value)

Parameters

  • object - Specifies the object auto-mapping will be enabled or disabled for.
  • value - Specifies whether auto-mapping will be enabled or disabled.

GetAutoMappingsFor()

Returns values indicating auto-mapping states for the specified objects. Each item in the array returned by the method corresponds to the item with the same index in the array of objects.

ADM_EXCHANGE_AUTOMAPINGSTATE_ENUM[] GetAutoMappingsFor(IAdmObjectReference[] objects)

Examples

The below code sample outputs auto-mapping states for objects that have the full access right over the user Exchange mailbox.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$userDN = "CN=John Smith,CN=Users,DC=company,DC=com"

# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly($serviceHost)

# Get Exchange properties.
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)
$mailboxParams = $user.GetMailParameters("ADM_GET_EXCHANGE_PARAMS_FLAGS_NONE")

# Get objects with full access.
$mailboxRights = $mailboxParams.MailboxRights
$fullAccess = $mailboxParams.MailboxRights.GetTrusteesGrantedRights(
    "ADM_EXCHANGE_MAILBOX_RIGHTS_FULL_ACCESS")

# Get auto-mapping states.
$autoMappingStates = $mailboxParams.MailboxRights.GetAutoMappingsFor($fullAccess)

for ($i = 0; $i -lt $fullAccess.Length; $i++)
{
    Write-Host $fullAccess[$i].DisplayName ":" $autoMappingStates[$i]
    Write-Host
}

GetTrusteesGrantedRights()

Returns the trustees granted the specified access right.

IAdmObjectReference[] GetTrusteesGrantedRights(ADM_EXCHANGE_MAILBOX_RIGHTS_ENUM accessRight,
                                               bool includeInheritedPermissions)

Parameters

  • accessRight - Specifies the access right granted to the trustees to return.
  • includeInheritedPermissions - Specifies whether to include inherited permissions.

SetTrusteesGrantedRights()

Grants the specified access right to the given trustees.

void SetTrusteesGrantedRights(IAdmObjectReference[] trustees,
                              ADM_EXCHANGE_MAILBOX_RIGHTS_ENUM accessRight,
                              bool includeInheritedPermissions)

Parameters

  • trustees - Specifies the trustees that will be granted the access right.
  • accessRight - Specifies the access right that will be granted to the specified trustees.
  • includeInheritedPermissions - Specifies whether inherited permissions will be taken into account when granting the access right.

Requirements

Minimum required version: 2019.1

See also