question

RajD-9527 avatar image
0 Votes"
RajD-9527 asked sikumars answered

Trouble connecting to Azure Active Directory

Greetings...

I am trying to authenticate my credentials using Azure Active Directory to write files to Azure File Share from my windows server. I am using the below cmdlet

cmdlet:

 Install-Module AzureAD
 Import-Module AzureAD
 Connect-AzureAD
 Get-AzureADUser

Error:

 Connect-AzureAD : The term 'Connect-AzureAD' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.


Not sure what all packages are required and where do I find them.

The below cmdlet shows what I have installed but when I search for the string AzureAD nothing is returned.

 (Get-Module -ListAvailable AzureAD*).path 

I tried installing module MSOnline and no luck.

 install-module MSOnline


Thank you




windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered

Hello @RajD-9527 ,

Thanks for your query.

The issue is that Cloud Shell provide a function which overrides the default Connect-AzureAD so that it uses the custom authentication mechanism Cloud Shell uses to avoid you having to re-enter credentials.

FYI: https://docs.microsoft.com/en-us/answers/questions/788725/39connect-azuread39-is-not-recognized-as-a-name-of.html


Best regards,
Leila


If the Answer is helpful, please click "Accept Answer" and upvote it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sikumars avatar image
0 Votes"
sikumars answered

Hi @RajD-9527 ,

Alternatively, could you please try using Microsoft Graph PowerShell instead to see if you can install and get Azure AD users list? Here is complete list of Azure Graph cmdlets for you reference.

Steps:

Install Graph Module
Authenticate to MS Graph using Connect-MgGraph -Scopes User.ReadWrite.All
To get user list, use following cmdlet Get-MgUser

Hope this helps.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.