Connect-msolservice error

General discussion of using Adaxes for Active Directory management and administration
Dmytro.Rudyi
Posts: 11
Joined: Mon Jun 10, 2019 7:31 am

Connect-msolservice error

Fri Jul 05, 2019 4:54 am

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!

User avatar
Support
Site Admin
Posts: 2373
Joined: Thu Apr 23, 2009 2:28 am

Re: Connect-msolservice error

Thu Jul 11, 2019 1:20 am

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.
    Service.properties.png
    Service.properties.png (8.05 KiB) Viewed 259 times
  4. Adaxes version will be displayed on the General tab.
    Service.version.png
    Service.version.png (8.16 KiB) Viewed 259 times
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Dmytro.Rudyi
Posts: 11
Joined: Mon Jun 10, 2019 7:31 am

Re: Connect-msolservice error

Thu Jul 11, 2019 1:33 am

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

User avatar
Support
Site Admin
Posts: 2373
Joined: Thu Apr 23, 2009 2:28 am

Re: Connect-msolservice error

Thu Jul 11, 2019 2:32 am

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?
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Dmytro.Rudyi
Posts: 11
Joined: Mon Jun 10, 2019 7:31 am

Re: Connect-msolservice error

Thu Jul 11, 2019 2:54 am

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.

User avatar
Support
Site Admin
Posts: 2373
Joined: Thu Apr 23, 2009 2:28 am

Re: Connect-msolservice error

Mon Jul 15, 2019 9:56 am

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.
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Dmytro.Rudyi
Posts: 11
Joined: Mon Jun 10, 2019 7:31 am

Re: Connect-msolservice error

Tue Jul 16, 2019 1:30 am

Hello!
I'm just running code directly via Powershell editor.
Screenshot_1.png
From Adaxes Console PS editor
Screenshot_1.png (55.5 KiB) Viewed 150 times
and at the same time same code, copy/paste from PS ISE on same server
Screenshot_2.png
From PS ISE
Screenshot_2.png (220.44 KiB) Viewed 150 times

User avatar
Support
Site Admin
Posts: 2373
Joined: Thu Apr 23, 2009 2:28 am

Re: Connect-msolservice error

Wed Jul 17, 2019 9:35 am

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?
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Dmytro.Rudyi
Posts: 11
Joined: Mon Jun 10, 2019 7:31 am

Re: Connect-msolservice error

Thu Jul 18, 2019 2:41 am

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 :)

User avatar
Support
Site Admin
Posts: 2373
Joined: Thu Apr 23, 2009 2:28 am

Re: Connect-msolservice error

Fri Jul 19, 2019 7:40 am

Hello Dmytro,
Dmytro.Rudyi wrote:
Thu Jul 18, 2019 2:41 am
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.
Dmytro.Rudyi wrote:
Thu Jul 18, 2019 2:41 am
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.
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests