I used this script from the repository https://www.adaxes.com/script-repository/check-if-number-of-unused-microsoft-365-licenses-is-below-limit-s594.htm
I have amended to include the skus I am concerned about so it now shows this:
$limit = 2 # TODO: modify me $skus = @("ENTERPRISEPACK","EMS") # TODO: modify me $Context.ConditionIsMet = $False $tenantDN = "%adm-AssociatedO365Tenant%" if ([System.String]::IsNullOrEmpty($tenantDN)) { $Context.LogMessage("No Microsoft 365 tenant is associated with the user", "Error") return } # Bind to Microsoft 365 tenant $tenant = $Context.BindToObjectByDN($tenantDN) # Check licenses foreach ($sku in $tenant.Skus) { if (($skus -ne $NULL) -and ($skus -notcontains $sku.SkuPartNumber)) { continue } $difference = $sku.TotalUnits - $sku.ConsumedUnits if ($difference -gt $limit) { continue } $Context.ConditionIsMet = $True }
I am using this in the 'Before user creation' area:
I just want to receive an email when the license count is below what I specify.
Please can you advise what I am doing wrong.
Hello,
The script and the configuration look correct. Please, clarify what makes you think that something is wrong. Did you try creating a user when the number of the Microsoft 365 licenses in question is below the specified number?
Hi,
Yes exactly that, I tried creating the user when we had 0 licenses and the email did not send.
Thank you for specifying. For further troubleshooting, please, post here or send us at support@adaxes.com the following:
A screenshot of the Send email notification action configuration. We need something like this:
A screenshot of the Create user operation Execution log. To take the screenshot:
Here are the screenshots as requested.
Thank you for the provided screenshots. According to the very first error in the Execution log, the account is created in the container that is not included into the Associated Directory Scope of the Microsoft 365 tenant registered in Adaxes.
thank you
I also use the above script and it usually works very well, only when I have freshly cleaned up the license pool it takes about 2h until the check is up to date again. Can I also achieve a faster update in Adaxes?
Hello Boris,
The easiest way is to just update Microsoft 365 tenant data manually after the changes to licenses/services are made: As another option, you can update parameter O365.UpdateTenantDataPeriod as described in the following article: https://www.adaxes.com/help/ChangeConfigurationParameters.
Thanks for the link, exactly what I needed. Perfect.
Is it possible to adapt the script so that it can be used in a report and the availability can be displayed directly on the homepage:
I have tried this, but unfortunately without success.
You can try using the following script fromk our repository: https://www.adaxes.com/script-repository/microsoft-365-licenses-information-s630.htm. If that is not what you need, please, describe the exact desired behavior in all the possible details with live exampels and possibly screenshots.
Hi, I used this script from the repository https://www.adaxes.com/script-repository/check-if-number-of-unused-microsoft-365-licenses-is-below-limit-s594.htm which works fine, but ... creation form, so I can see if whether it makes sense to fill out the form
Hi Team, We are using a set of form/business rules/custom commands for user creation that move user account to the right OU given the Office attribute value. I would ... , but can't find valuable information on the web site. Thanks in advance Regards Stephen
Hi, I need a bit of scripting help within Adaxes. We have a number of o365 licence checks that occur, some on a schedule, some before creating a ... $to -from $from -SmtpServer $smtpServer -Subject $messageSubject -Body $messageBody Remove-PSSession $session
Hi there we use personal identity number in one of our customattribute. How would you script this so it checks that the number that we specify when filling out the form ... process should be interupted and we then know that that user already has an account.
When attempting to assign licenses during the "after creating a user" rule we're reciving the following error. Failed to create a remote mailbox for the user. The address ' ... mail attribute to the proper format that isn't the onmicrosoft.com domain as well.