0 votes

Hi

I'm trying to add your report from here but whenever I run it, I get 2 errors for each user which seem to correspond to the following 2 lines in the script

"$searchIterator = $Context.DirectorySearcher.ExecuteSearch()" "$searchResult = $searchIterator.Current"

I did wonder if this is because the DirectorySearcher still trying to use AppendFilter, so I tried changing this to

$criteria = New-AdmCriteria "user"
$Context.DirectorySearcher.AddCriteria($criteria)

But I still get the same error's. image.png

Thanks

Matt

by (2.0k points)

1 Answer

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

Hello Matt,

Your changes to the script are correct. We made them in the repository as well. With the changes the script work just fine in Adaxes 2023 and 2023.2. Make sure that you properly configure the parameter and custom column.

0

I'm glad I'm half way there!

Just to check, for the SKU for Business premium

image.png

The value when checked for the check list will be SPB?

0

Hello Matt,

Yes, that is correct.

0

Hmm, I must be missing something then. Here's my parameter image.png

and here's the first part of the script, the rest is unchanged from your template

$licensesColumnID = "{edca8ffc-39ba-4feb-adde-545c779b32d1}" # TODO: modify me
$licensesParameterName = "param-Licenses" # TODO: modify me
$separator = ";" # TODO: modify me

# Get licenses to check
$licensesToCheck = $Context.GetParameterValue($licensesParameterName).Split($separator)

$criteria = New-AdmCriteria "user"
$Context.DirectorySearcher.AddCriteria($criteria)
try
{
    $searchIterator = $Context.DirectorySearcher.ExecuteSearch()

Yet when I run the report, I get 2 errors for every user.

image.png

I'm running Adaxes 3.16.21906.0 in a non HA setup on Server 2022.

0

Hello,

How exactly did you configure the custom column? Please, provide us with a screenshot of the Value Calculation tab. image.png You can post the screenshot here or send to us at support@adaxes.com.

0

Oh dear, oh dear, oh dear! It seems I've been a little bit of an idiot and put your script in the custom column calculation image.png

I'm so sorry for wasting your time.

Thanks as always for your amazing support though.

Matt

Related questions

0 votes
1 answer

Is there a way to add Microsoft Defender for Office 365 Plan 2 licenses from Adaxes? Currently it is not showing in the list of available licenses to modify. The endpoint ... the E3 license is showing up no problem, just not the standalone one for O365.

asked Aug 20 by Alex23 (50 points)
0 votes
0 answers

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.

asked Sep 2, 2021 by zorps (20 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

I have a custom command, copied from the buit-in deprovisioning script, that revokes all licenses and blocks sign in; however, I get an insufficient permissions error on the ... be happening. I can assign licenses with no issues. Any help would be appreciated.

asked Apr 12, 2023 by Michael Long (70 points)
0 votes
0 answers

Ever since upgrading to 3.16.21906.0 the script here no longer works: https://www.adaxes.com/script-repository/move-mailbox-tofrom-microsoft-365-s579.htm Not sure what the issue is as I can't find any errors in the log.

asked Nov 16, 2023 by curtisa (290 points)
3,588 questions
3,277 answers
8,303 comments
548,089 users