none
AzureAD powershell module

    Question

  • Hello all

    I am running Windows 10, 64 bit and I have installed the AzureAD powershell 64 bit module, version 2.0.0.109. The module is installed on my local machine at "C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.0.109".  I have imported  the module by running import-module AzureAD. When I run the command "connect-AzureAd" I get a windows credential prompt, after entering in my credentials and running the command "get-azureADuser" I get "You must call the Connect-AzureAD cmdlet before calling any other cmdlets".  Why am I getting this message? When I run the command "azuread\Connect-AzureAD" I get a modern authentication dialog box prompt that's below. After entering in my credentials I can connect and run the azureAD cmdlets.  If I wanted to run an automated script that connects to AzureAD, how do I need to pass credentials in the script , to automatically log in?

     


    skipster

    Tuesday, May 02, 2017 4:53 PM

All replies

  • You can pass Credentials object to the Connect-AzureAD cmdlet, however that essentially bypasses 2FA and will fail if you have it configured.

    Connect-AzureAD -Credential $cred

    Tuesday, May 02, 2017 7:56 PM
  • Same issue, did you find an answer?
    Monday, May 22, 2017 1:38 PM