0 votes

How does Adaxes handle the situation when creating an account in Office 365, but there are no available licenses to assign? Can it add a license to an subscription? If there is a process that creates an AD account, performs other operations, and then tries to create the o365 account and fails at the point of assigning a license, does it error? Is there a way to have Adaxes check for an available o365 licenses before starting any part of the user creation, and displaying an error such as "No available licensing to assign, you must first add a license to the subscription before creating the user".

I am trying to avoid a scenario where the user creation process fails 75% of the way through, leaving an account that is only partially set up.

Thanks very much.

by (540 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello Jason,

How does Adaxes handle the situation when creating an account in Office 365

There will be an error in the Execution Log.

Can it add a license to an subscription?

No.

Is there a way to have Adaxes check for an available o365 licenses before starting any part of the user creation, and displaying an error such as "No available licensing to assign, you must first add a license to the subscription before creating the user".

Yes, this can be done using a If PowerShell script. For details, see the following script in our repository: http://www.adaxes.com/script-repository ... s-s487.htm.

0

Great, thanks for the help.

0

Hello,
I have been using the script in the old response above and I have run into an issue. I am trying to do a check for an available license before user creation, and our licenses look like this (for example):

When the script for the license check runs, it checks every plan listed, and will fail if ANY line has 0 of X licenses available.
I am trying to adjust the script so that it only checks ONE plan for a license before user creation, for example:


In this case, I just want to check for the highlighted plan, and continue if that plan has at least one license available.

Can you help? Thanks.

0

Hello Jason,

Find the updated script below. In the script:

  • $limit - specifies the minimum number of licenses that must always be available. If the number of available licenses is below the limit, user creation is cancelled;

  • $skuPartNumber - specifies the SKU part number of the Office 365 plan for which available licenses will be checked.
    To get the SKU part number:

    1. Launch Adaxes Administration Console.
    2. In the Console Tree, expand your service node.
    3. Navigate to Configuration\Cloud Services and select Office 365.
    4. In the Result Pane on the right, right-click your Office 365 tenant and click Edit in the context menu.
    5. On the Tenant Details tab, click the Office 365 plan you need to check in the script.
    6. The plan SKU part number will be displayed below the Display name field.
$limit = 2 # TODO: modify me
$skuPartNumber = "ENTERPRISEPACK" # TODO: modify me

if ([System.String]::IsNullOrEmpty("%adm-AssociatedO365Tenant%"))
{
    return # There are no Office 365 Tenants associated with the new user
}
$tenant = $Context.BindToObjectByDN("%adm-AssociatedO365Tenant%")

# Check licenses
foreach ($sku in $tenant.Skus)
{
    if (-not($sku.SkuPartNumber -ieq $skuPartNumber))
    {
        continue
    }

    $difference = $sku.TotalUnits - $sku.ConsumedUnits
    if ($sku.Enabled -and ($difference -lt $limit))
    {
        $Context.Cancel("The number of Office 365 licenses is insufficient. User will not be created.")
        return
    }
}
0

Fantastic, thank you.

Related questions

0 votes
1 answer

Hi, I try to make a report for our SAM to show all users with a specific license. But I fail to even find anything. I tried, among many ... .DirectorySearcher.AppendFilter("(adm-O365AccountLicenses=POWER_BI_STANDARD)") But I get nothing. Please advice.

asked May 20, 2021 by KristofferJ (80 points)
0 votes
1 answer

We need to capture the Office365 (if any) on the user account before we disable. These are accounts taht are temps or contractors that we disabled and re enable for ... Example of group name is Office-E3-EXO and we want to capture it to CustomAttributeText31

asked Aug 4, 2020 by willy-wally (3.2k points)
0 votes
1 answer

I'm trying to retrive the Microsoft 365 License product name in a report as the 'Office 365 License' attribute in Adaxes shows each individual licensed product e.g. ... 365 F3"} } $productnames = $productnames -join ", " $Context.Value = $productnames

asked Jul 27, 2020 by richarddewis (260 points)
0 votes
1 answer

When attempting to add an O365 license to an AD account via the Adaxes admin console, I noticed that it is missing some license types (e.g. Azure AD Premium P1). In ... Is there a way to configure Adaxes to pull all available license types from O365? Thanks!

asked Oct 22, 2019 by EricB (70 points)
0 votes
1 answer

I am wondering what the expected behavior is, and what troubleshooting can be done, for this issue: We have a few tenants listed under Cloud Services > Office 365 We ... know, but they don't have access to force the license update themselves. Thanks, Jason

asked Jan 9, 2019 by Jasonmh (540 points)
3,589 questions
3,278 answers
8,303 comments
548,106 users