PowerShell Azure AD

chris_nawig 41 Reputation points

Hi guys,

How to query Azure AD?

If I have my Windows or Mac device, how do i set the credentials to start querying AD?

If I will use Python and PowerShell, how do i set the authentication?

Thanks for any help.

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

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,301 Reputation points

    Hi @chris_nawig · Thank you for reaching out.

    To connect to Azure AD via PowerShell, you need to run Connect-AzureAD cmdlet after installing Azure AD PowerShell Module.

    To store the credentials in variable, you can run:

    $Credential = Get-Credential  
    Connect-AzureAD -Credential $Credential  

    Note: If you are storing credentials in variable, MFA must be disabled for the user account.

    For Python, you can refer to this code sample.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    2 people found this answer helpful.
    0 comments No comments