0 votes

Dear Support,
can you please advise how to properly troubleshoot Connect-MSOlService? I have x64 Adaxes installation
I have this function properly working in Powershell ISE and Powershell console on the Adaxes server, but when I try to run it in PS script inside Adaxes - I get a 1 minute wait and then "Object reference not set to an instance of an object".

I have Microsoft Online Services Sign-In Assistant install from https://www.microsoft.com/en-us/downloa ... x?id=28177

I have MSOnline module installed via Powershell.
Version Name Repository Description
------- ---- ---------- -----------
1.1.183.17 MSOnline PSGallery Microsoft Azure Active Directory Module for Wind...
Powershell version 5.1

Thanks for any advise!

by (920 points)
0

Hello Dmytro,

Could you, please, post here or send us (support[at]adaxes.com) the script you are using in Adaxes. A detailed description of the script usage will be also appreciated.

What version of Microsoft .NET Framework is installed on the computer where Adaxes service runs?

What version of Adaxes you are currently using? To check the version:

  1. Launch Adaxes Administration Console.
  2. In the Console Tree, right-click your service.
  3. In the context menu, click Properties.
  4. Adaxes version will be displayed on the General tab.
0

Hello,
Adaxes version is 3.11.16721.0
.NET Framework 4.6.2
Code is standard:

$Usr = "XXXXXX"
$Pwd = ConvertTo-SecureString -String "XXXXXX" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential($Usr, $Pwd)

connect-msolservice -Credential $Credential

0

Hello Dmytro,

Thank you for the details. The script should work just fine. Could you, please, clarify how exactly the script runs in Adaxes? In what format do you specify the username in the $Usr variable?

0

I specify it as upn - xxx@xxx.com.
This script is actually working in Powershell ISE open on server, but not from console on same server.
But access to internet from server is via proxy.

0

Hello Dmytro,

Could you, please, post here or send us (support[at]adaxes.com) the full script and clarify how it is executed (by a Custom Command, a Business Rule or a Scheduled Task)? A screenshot of the command/rule/task would be much appreciated.

0

Hello!
I'm just running code directly via Powershell editor.
(From Adaxes Console PS editor)
and at the same time same code, copy/paste from PS ISE on same server
(From PS ISE)

0

Hello Dmytro,

Thank you for the clarification. For troubleshooting purposes, could you, please, enable tracing of requests sent to Office 365, reproduce the issue and then check the log file? For information on how to enable the tracing, have a look at the following help article: https://www.adaxes.com/help/?HowDoI.Per ... uests.html. If you are not sure, you can send the log file to us (support[at]adaxes.com).

Also, could you clarify if the Office 365 tenant which you try to connect to via the script is registered in Adaxes and works fine?

0

Hello,
after changing config file - the log doesn't appear while running this code. So it doesn't even send the request, I guess
No, this tenant is not registered in Adaxes, but it works fine :)

0

Hello Dmytro,

No, this tenant is not registered in Adaxes, but it works fine

Could you, please, try to register the tenant in Adaxes? For details, have a look at the following tutorial: https://www.adaxes.com/tutorials_Active ... htm#tenant.

after changing config file - the log doesn't appear while running this code. So it doesn't even send the request, I guess

The log does not appear because the tenant is not registered in Adaxes.

0

Hello,
Unfortunately I can't since I don't have admin priveleges in Azure tenant, I'm managing only on-premise AD. But we really need to pull the license info to adaxes.
Is there any other way to troubleshoot this?

0

Hello Dmytro,

Object reference not set to an instance of an object.” is a very common error and can occur because of multiple reasons. To troubleshoot the issue, you need to register a tenant in Adaxes. It is not necessarily should be your production tenant. You can create a dummy tenant in Office 365 and then register it in Adaxes without association with any scope of your domain.

0

Hello,
I've created a test tenant and tried to add it. The irony is that I get same error message :lol:

![]()

1 Answer

0 votes
by (920 points)
selected by
Best answer

Dear Support,
thanks for your help - we've found the issue. Proxy had to be set up manually under service account - settings set up in Adaxes configuration (proxy) - didn't work.

Related questions

0 votes
1 answer

Hi, we are using Adaxes version 3.14.18920.0. We have Teams Poweshell module 2.3.1 installed on the computer where adaxes service runs. We have the ... } finally { # Close the connection and release resources Disconnect-MicrosoftTeams -Confirm:$False }

asked Jun 22, 2021 by TJ_Umredkar (140 points)
0 votes
1 answer

Hi, We've recently started seeing users get 'Unable to connect to nearest Adaxes service' errors when accessing the Adaxes web portal. It's far too vague\random to have an idea ... last night to see if that fixed it, but we have had the issue again today.

asked Dec 13, 2013 by firegoblin (1.6k points)
0 votes
1 answer

We still use MsolService (MSOnline) Cmdlets because newer modules don't have some of the features. With the depreciation of GetOffice365Credential ... the Azure token? Connect-MsolService -AdGraphAccessToken $Context.CloudServices.GetAzureAuthAccessToken()

asked Feb 19, 2021 by Staj (350 points)
0 votes
1 answer

Hi, I need to retreive a secret from a Azure Keyvault in a business rule. I have a powershell script that works if i run a external command. But it fails if ... at <ScriptBlock>, <No file>: line 20 Any sugestion? Kind regards Reidar Dick-Henriksen

asked Dec 6, 2023 by reidardh (20 points)
0 votes
1 answer

I am trying to use this script from the script repository: https://www.adaxes.com/script-repository/enable-mfa-with-phone-number-for-a-user-in-microsoft-365-s686.htm I ... if I just didn't install it correctly because Adaxes Powershell doesn't recognize it.

asked Oct 10, 2023 by ocanizales (60 points)
3,548 questions
3,238 answers
8,232 comments
547,812 users