0 votes

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, this script filter: $Context.DirectorySearcher.AppendFilter("(adm-O365AccountLicenses=POWER_BI_STANDARD)") But I get nothing. Please advice.

by (80 points)
0

Hello Kristoffer,

Could you, please, specify what version of Adaxes you are currently using? For information on how to check it, have a look at the following help article: https://www.adaxes.com/help/CheckServiceVersion.

0

I run 3.14.18920.0

0

Hello Kristoffer,

Thank you for specifying. For us to provide instructions on creating the report, please, specify whether you need the possibility to select the Microsoft 365 license for report generation or it should be predefined. Any additional details regarding the desired behavior will be much appreciated.

0

Yes. I want to be able to select in a drop down the Office 365 license that we want to get the report on. Then get just a list of all accounts that has the license assigned to it, name, displayname, company and department. Quiet simple, but as said, I can't get the filter to work. Getting the drop down populated dynamically would of course be nice. I have seen how to adjust the display names of licenses.

0

Hello Kristoffer,

Thank you for the provided details. The drop-down parameter can only be updated by a separate scheduled task. Unfortunately, it cannot be done dynamically in the report itself. Does this approach meet your needs?

0

Yes, creating the dropdown is the least of problems here, it is the filtering to get all users with a specified license that is the main problem.

1 Answer

0 votes
by (288k points)

Hello Kristoffer,

Thank you for the confirmation. Use the following script from our repository to populate the parameter with Microsoft 365 licenses: https://www.adaxes.com/script-repository/update-report-drop-down-parameter-with-microsoft-365-licenses-s622.htm. To create the report:

  1. Launch Adaxes Administration console.
  2. In the Console Tree, right-click your service node.
  3. In the context menu, navigate to New and click Report. image.png
  4. Specify a report name.
  5. Select Active Directory search and click Next. image.png
  6. Click New.
  7. Click Next twice and then click Finish.
  8. Click Next.
  9. Click New.
  10. Select Drop-down list and click Next. image.png
  11. Specify a parameter name and display name (e.g. microsoft365License and Microsoft 365 License). image.png
  12. Click Next.
  13. Click New.
  14. Specify a value (you can specify anything as the parameter will be updated by the scheduled task and the value is only required to create the parameter).
  15. Click OK and then click Finish.
  16. Click Next twice.
  17. In the Search filter field, enter the following: (sAMAccountType=805306368)
  18. Click Exclude (it will change to Include). image.png
  19. Click Add Condition.
  20. Select If is licensed for Microsoft 365 and click OK. image.png
  21. Right-click the condition you created and then click Add New Condition. image.png
  22. Select If PowerShell script returns true.
  23. Paste the below script into the script field. In the script, the $licenseToCheck variable should be set to a value reference of the parameter created on steps 9-15.
$licenseToCheck = "%param-microsoft365License%" # TODO: modify me

$Context.ConditionIsMet = $False
try
{
    # Get Microsoft 365 account properties
    $microsoft365Properties = $Context.TargetObject.GetOffice365Properties()
}
catch
{
    return # No Microsoft 365 account
}

# Get assigned licenses
$licenses = $microsoft365Properties.Licenses

foreach ($license in $licenses)
{
    if (($license.Assigned) -and ($license.Sku.SkuPartNumber -eq $licenseToCheck))
    {
        $Context.ConditionIsMet = $True
        return
    }
}
  1. Enter a short description and click OK. image.png
  2. Click Next and finish creating the report.
0

Thank you very much for the solution, as quick, it indeed works. But it is extremely slow. I guess it pulls out each user and query Azure Ad for license info. And I actually timed out after a while for a license with 135 users. Why can't we pull out the data in the Microsoft 365 License property on the user and filter on that?

0

Hello Kristoffer,

Unfortunately, there is no other possibility to query Microsoft 365 licenses assigned to a user. As for LDAP filters, the thing is that Adaxes calculated properties and custom attributes cannot be used in the filters. As a solution, you can try using specific scopes to check less user accounts at a time.

0

Ok I will go for that. Thank you for the reply, and not the least, the solution. I learned a lot of what we can do in Adaxes and the high quality of the support.

Best Regards Kristoffer

0

Hello Kristoffer,

Thank you for your good words, it is much appreciated! Should you have any questions or need clarifications, do not hesitate to contact our Support Team.

Related questions

0 votes
1 answer

Hi: I am trying to create a business rule that will stop a value change based on the existing value. For example, if the telephonenumber is 1234 for a group and has to ... the value it uses is the incoming value of the change, not the existing value. Thanks!

asked Jun 3, 2022 by crobitaille (80 points)
0 votes
1 answer

I need set, or verify, that all of my users have the same primary email alias suffix. Several years ago, we rebranded to a new internet presence. All users yhave both ... really a very great answer. Looking for automation, and we are an Adaxes supported shop.

asked May 14, 2021 by IanMcLaws (20 points)
0 votes
1 answer

We have a rule setup that when a user requests membership into a group it will email approvers of the group for approval. I would like to create a report that sends out a list of ALL approvers for every group we have approvals setup for.

asked Dec 18, 2023 by jujones79 (20 points)
0 votes
1 answer

This is for license purposes and we do not want them visible in the Adaxes portal.

asked Oct 22, 2021 by jfrederickwl (20 points)
0 votes
0 answers

An authenticator app can be reset for a user with the help of the Reset multifactor authentication operation in Adaxes Web Interface or Administration Console. In the Web ... can also use the Change device option. For details, see Reset Authenticator App.

asked Oct 28, 2019 by Adaxes (560 points)
3,541 questions
3,232 answers
8,225 comments
547,802 users