通过Microsoft Graph的API如何来查看用户信息和登录记录呢?
比如一个拥有查看用户权限的Azure账号,通过Azure CLI 命令获取到一个Access Token
az cloud set --name AzureChinaCloud az login az account get-access-token --resource 'https://microsoftgraph.chinacloudapi.cn/'
GET: https://microsoftgraph.chinacloudapi.cn/v1.0/users?$filter=userPrincipalName eq '<user name>'
Authentication :<第一步中获取的Access Token>

GET : https://microsoftgraph.chinacloudapi.cn/beta/auditlogs/signIns?$filter=userPrincipalName eq '<user name>'
Authentication :<第一步中获取的Access Token>

PS: 返回值“createdDateTime”就是最后一次登录的时间
Microsoft Graph REST API beta endpoint reference : https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-beta