Query Azure AD (Connect-AzureAD) unattended with Azure App Registration certificate PFX

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Demo showing how to query Azure AD in PowerShell. Walk each step with full PowerShell source code available.
    1) Execute "Connect-AzureAD" with admin user
    2) Create self signed certificate PFX for unattended login
    3) Create new App Registration
    4) Grant permission "User.ReadAll" to MS Graph API
    5) Execute "Connect-AzureAD" with unattended certificate PFX login
    6) Execute query "Get-AzureADUser" to display results
    Please leave comment with suggestions and questions. Cheers.

Комментарии • 13

  • @FEYSCONTROL
    @FEYSCONTROL Год назад +1

    After 2 days in labyrinthing on the net finally I found you. Thank you! Job done! :)

  • @gabigdawg1
    @gabigdawg1 7 месяцев назад

    Wish you had included the powershell script. Hard to read on the monitor and this is such a great solution!

  • @farhanhashmi1095
    @farhanhashmi1095 7 месяцев назад

    That's what I needed Thanks PAL 👍

  • @lordraf5255
    @lordraf5255 10 месяцев назад

    excellent content, thank you! :)

  • @ZailaniAsralSG
    @ZailaniAsralSG Год назад

    Thank you Jeff!

  • @noxnostalgia9299
    @noxnostalgia9299 2 месяца назад

    I tried all of these, but the moment I deleted the thumbprint saved in mmc, everything started to fail. It says that it cannot find the thumbprint, even though we uploaded it in the App registration. What is the purpose of the App Registration's thumbprint? If we deploy a script with this authentication method, to let's say, Azure Automation, will the script still work? Or will it start looking for that local thumbprint?

  • @oranais3074
    @oranais3074 2 года назад

    Excellent, just what I was looking for. Well explained too. Where can I find the source code? Thank you.

    • @spjeff
      @spjeff  2 года назад +1

      Awesome. Thank you. Code at github.com/spjeff/spadmin/blob/master/Connect-AzureAD.ps1

    • @Devvbot
      @Devvbot Год назад

      @@spjeff RIP That link

    • @Joly0
      @Joly0 10 месяцев назад

      @@spjeff What happened? All your Github content is gone so is the skript?

  • @2007pradipta
    @2007pradipta 2 года назад

    instead of certificate thumbprint can we use Client Secret to connect ?

  • @user-nm7bf3he1p
    @user-nm7bf3he1p 7 месяцев назад

    from where in can get the script?

  • @ToddCBrown
    @ToddCBrown Год назад

    Thank you for this. It really looks like it would solve my needs. I attach well and it looks like all is well, but when I finally attach I then get this response: (X's and ?'s to protect the innocent)
    Get-AzureADUser : Error occurred while executing GetUsers
    Code: Authorization_RequestDenied
    Message: Insufficient privileges to complete the operation.
    RequestId: XXXXXXX-????-XXXX-????-XXXXXXXXXXXX
    DateTimeStamp: Wed, 04 Jan 2023 20:13:24 GMT
    HttpStatusCode: Forbidden
    HttpStatusDescription: Forbidden
    HttpResponseStatus: Completed
    At line:1 char:10
    + $users = Get-AzureADUser
    + ~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-AzureADUser], ApiException
    + FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetUser