Azure Cloud Shell, The term 'Get-MsolUser' is not recognized as a name of a cmdlet

Sylwester 5 Reputation points

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 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
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,161 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,146 Reputation points Microsoft Employee

    @Sylwester Instead of using Azure Cloud Shell , can you try using the local powershell window

    Install-Module MSOnline -Force



    Below are my tests in cloudshell & Local windows:

    User's image