51CTO Blog地址:https://blog.51cto.com/u_13969817
在上文中我们介绍了如何在Azure AD中注册Application并授权相关Graph API,本文将给大家介绍开发者如何使用App ID和Certificate(Secret)通过PowerShell连接Graph API?
采用App ID和Certificate通过PowerShell连接Graph API的命令如下所示:
$TenantID = "85b08a4b-e46b-421f-a3e6-fb7db83ca52d"
$ClientID = "92aafeaa-dec2-433f-9e6b-eb594c489ba9"
$CertThumbPrint = "378A3593FDA20680D475C97E4B02735E000A9C74"
Connect-MgGraph -ClientID $ClientID -TenantId $TenantID -CertificateThumbprint $CertThumbPrint
采用App ID和Secret通过PowerShell连接Graph API的命令如下所示:
1. Application 相关的信息如下所示:
$TenantID = "85b08a4b-e46b-421f-a3e6-fb7db83ca52d"
$ClientID = "92aafeaa-dec2-433f-9e6b-eb594c489ba9"
$ClientSecret = "o148Q~bJ9.jmG0pX5MBpCDleo7feCK20InFoUaLR"
2. 使用Secret连接Graph API,如下所示:
标签:Graph,App,ClientID,API,所示,ID From: https://blog.51cto.com/u_13969817/9386123