Skip to content

IAdmO365Sku

The IAdmO365Sku interface represents a Microsoft 365 license plan. License plans are stored as directory objects at Adaxes Configuration Server (AD LDS).

Inheritance: The IAdmO365Sku interface inherits from the IAdmTop interface.

Methods

  • Method

  • Description

  • ValidateServices()

  • Checks whether the specified set of Microsoft 365 services can be assigned to a user.

Properties

  • Property

  • Description

  • SkuId

  • Gets the unique identifier of the Microsoft 365 plan within the tenant.

  • AccountSkuId

  • Gets the ID of the plan that is unique outside the tenant.

  • SkuPartNumber

  • Gets the name of the Microsoft 365 plan (e.g. ENTERPRISEPACK).

  • TotalUnits

  • Gets the total number of licenses available in the Microsoft 365 plan.

  • ConsumedUnits

  • Gets the number of licenses currently assigned to users.

  • CustomDisplayName

  • Gets or sets a custom display name for the Microsoft 365 plan.

  • DefaultDisplayName

  • Gets a default display name that is used to represent the Microsoft 365 plan.

  • Enabled

  • Gets or sets a value that indicates whether the Microsoft 365 plan is enabled in Adaxes and its licenses can be assigned to users.

  • Services

  • Gets or sets a list of services available in the Microsoft 365 plan.

Details

ValidateServices()

Checks whether the specified set of Microsoft 365 services can be assigned to a user.

Boolean ValidateServices(IAdmO365Service[] services, out String warning)

Parameters

  • services – Specifies the set of services to validate.
  • warning – An output (OUT) parameter that returns a message indicating which services in the set cannot be assigned, and why.

Return value

The method returns FALSE if validation failed. In that case, the warning parameter contains the list of services that cannot be assigned, and also the services that need to be included into the set and/or enabled for successful validation.

Remarks

When validating services in the set, the method takes into account the availability of all dependent services in the set as well as their status (enabled or disabled). For example, if the Office Web Apps service is included in the set and enabled, the method checks whether the SharePoint Online service it depends on, is also present in the set and enabled.

Examples

The following code sample validates services in all Microsoft 365 license plans available in a tenant.

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

$tenantName = "MyTenant"

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

# Bind to the 'Microsoft 365' container
$configurationContainerPath = $admService.Backend.GetConfigurationContainerPath("CloudServicesO365")
$configurationContainer = $admService.OpenObject($configurationContainerPath, $NULL, $NULL, 0)

# Bind to the Microsoft 365 tenant
$tenant = $configurationContainer.GetObject("adm-O365Tenant", "CN=$tenantName")

# Validate services
foreach ($sku in $tenant.Skus)
{
    $warning = [System.String]::Empty
    if ($sku.ValidateServices($sku.Services, [ref]$warning))
    {
        Write-Host "Validation of the " $sku.DefaultDisplayName "plan succeeded"
        continue
    }

    Write-Host "Validation of the " $sku.DefaultDisplayName "plan failed"
    Write-Host "`tReason:" $warning
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.CloudServices.Office365;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;

class Program
{
    static void Main(string[] args)
    {
        const String tenantName = "MyTenant";

        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Bind to the 'Microsoft 365' container
        String configurationContainerPath = admService.Backend.GetConfigurationContainerPath(
            "CloudServicesO365");
        IADsContainer configurationContainer = (IADsContainer)admService.OpenObject(
            configurationContainerPath, null, null, 0);

        // Bind to the Microsoft 365 tenant
        IAdmO365Tenant tenant = (IAdmO365Tenant)configurationContainer.GetObject("adm-O365Tenant", "CN=" + tenantName);

        // Validate services
        foreach (IAdmO365Sku sku in tenant.Skus)
        {
            String warning;
            if (sku.ValidateServices(sku.Services, out warning))
            {
                Console.WriteLine("Validation of the " + sku.DefaultDisplayName + " plan succeeded");
                continue;
            }

            Console.WriteLine("Validation of the " + sku.DefaultDisplayName + " plan failed");
            Console.WriteLine("\tReason: " + warning);
        }
    }
}

SkuId

Gets the unique identifier of the Microsoft 365 plan within the tenant.

  • Type:
  • String
  • Access:
  • Read-only

AccountSkuId

Gets the ID of the plan that is unique outside the tenant.

  • Type:
  • String
  • Access:
  • Read-only

SkuPartNumber

Gets the name of the Microsoft 365 plan (e.g. ENTERPRISEPACK).

  • Type:
  • String
  • Access:
  • Read-only

TotalUnits

Gets the total number of licenses available in the Microsoft 365 plan.

  • Type:
  • Int32
  • Access:
  • Read-only

ConsumedUnits

Gets the number of licenses currently assigned to users.

  • Type:
  • Int32
  • Access:
  • Read-only

CustomDisplayName

Gets or sets a custom display name for the Microsoft 365 plan.

  • Type:
  • String
  • Access:
  • Read/Write

Remarks

If the property is empty, Adaxes uses the name specified in the DefaultDisplayName property to represent the Microsoft 365 plan.


DefaultDisplayName

Gets a default display name that is used to represent the Microsoft 365 plan.

  • Type:
  • String
  • Access:
  • Read-only

Remarks

If the CustomDisplayName property is set, Adaxes uses the name specified in it to represent the plan.


Enabled

Gets or sets a value that indicates whether the Microsoft 365 plan is enabled in Adaxes and its licenses can be assigned to users.

  • Type:
  • Boolean
  • Access:
  • Read/Write

Services

Gets or sets a list of services available in the Microsoft 365 plan.

Examples

The following example outputs all available Microsoft 365 services and their status.

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

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

# Bind to the 'Microsoft 365' container
$configurationContainerPath = $admService.Backend.GetConfigurationContainerPath("CloudServicesO365")
$configurationContainer = $admService.OpenObject($configurationContainerPath, $NULL, $NULL, 0)

foreach ($tenant in $configurationContainer)
{
    # Output tenant name
    Write-Host "Tenant name:" $tenant.TenantName

    # Get license plans associated with the tenant
    $skus = $tenant.Skus

    foreach ($sku in $skus)
    {
        Write-Host "`tPlan:" $sku.DefaultDisplayName

        # Output information about each service
        $services = $sku.Services

        Write-Host "`tServices:"
        foreach ($service in $services)
        {
            Write-Host "`t`tDisplay name:" $service.ServiceDisplayName
            Write-Host "`t`tEnabled:" $service.Enabled
            Write-Host
        }
        Write-Host
    }
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.CloudServices.Office365;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;

class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Bind to the 'Microsoft 365' container
        String configurationContainerPath = admService.Backend.GetConfigurationContainerPath(
            "CloudServicesO365");
        IADsContainer configurationContainer = (IADsContainer)admService.OpenObject(
            configurationContainerPath, null, null, 0);

        foreach (IAdmO365Tenant tenant in configurationContainer)
        {
            // Output tenant name
            Console.WriteLine("Tenant name: " + tenant.TenantName);

            // Get license plans associated with the tenant
            IAdmO365Sku[] skus = tenant.Skus;

            foreach (IAdmO365Sku sku in skus)
            {
                Console.WriteLine("\tDisplay name: " + sku.DefaultDisplayName);

                // Output information about each service
                IAdmO365Service[] services = sku.Services;

                Console.WriteLine("\tServices:");s
                foreach (IAdmO365Service service in services)
                {
                    Console.WriteLine("\t\tDisplay name: " + service.ServiceDisplayName);
                    Console.WriteLine("\t\tEnabled: " + service.Enabled);
                    Console.WriteLine();
                }
                Console.WriteLine();
            }
        }
    }
}

Requirements

Minimum required version: 2014.1

See also