@Sylwester Instead of using Azure Cloud Shell , can you try using the local powershell window
Install-Module MSOnline -Force
Connect-MsolService
Get-MsolUser
Below are my tests in cloudshell & Local windows:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I try to run few PowerShell commands via Cloud Shell. I'm launching Cloud Shell being logged in as global administrator of Office 365, I activates Azure subscription to be able to use powershell in cloud. I need output from:
Get-MsolUser -All | Where {$_.ProxyAddresses -like "smtp:<UPN value>"} | select UserPrincipalName, ImmutableId,proxyaddresses
But I cant get even this working:
Get-MsolUser -All
Solutions I tried already:
PS /home/sylwester> Install-Module -Name AzureAD
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the
modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
PS /home/sylwester> Import-Module -Name AzureAD
Import-Module: Assembly with same name is already loaded
PS /home/sylwester> Get-Command -Module AzureAD -Name Get-MsolUser
Get-Command: The term 'Get-MsolUser' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS /home/sylwester> Get-Module -Name AzureAD -ListAvailable
ModuleType Version PreRelease Name PSEdition ExportedCommands
Binary 2.0.2.140 AzureAD Desk
PS /home/sylwester> Import-Module -Name AzureAD -Force
Untrusted repository
PS /home/sylwester> Import-Module -Name AzureAD -Force
PS /home/sylwester> Get-Command -Module AzureAD -Name Get-MsolUser
The term 'Get-MsolUser' is not recognized as a name of a cmdlet, function
@Sylwester Instead of using Azure Cloud Shell , can you try using the local powershell window
Install-Module MSOnline -Force
Connect-MsolService
Get-MsolUser
Below are my tests in cloudshell & Local windows: