Need to set MsolCompanySettings but unable to load Connect-MsolService

Devs CS 21 Reputation points
2021-08-04T09:36:45.74+00:00

Hello,

Ultimately I want to allow email verified users by setting Set-MsolCompanySettings -AllowEmailVerifiedUsers $true.

So I run the Azure PowerShell from Azure Cloud Shell (run from my browser).

When entering command Set-MsolCompanySettings -AllowEmailVerifiedUsers $true I get: Set-MsolCompanySettings: You must call the Connect-MsolService cmdlet before calling any other cmdlets.

So I enter Connect-MsolService and I get

`Connect-MsolService: Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=*****'. The system cannot find the file specified.

Connect-MsolService: Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=*****'. The system cannot find the file specified`

I already tried to re-install MSOnline to no avail.

Any ideas?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,381 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 94,521 Reputation points MVP
    2021-08-04T10:40:42.107+00:00

    The module cannot be run from Azure Cloud Shell. You need a Windows PowerShell host for it.


1 additional answer

Sort by: Most helpful
  1. William Fulmer 11 Reputation points
    2022-05-19T13:32:35.927+00:00

    Correct. This also does not work on MacOS PowerShell. This requires a Windows OS with the Sign-In Assistant Module loaded.

    0 comments No comments