通过 Microsoft Graph 检查目录邀请的兑换状态
Check Redeem status of Directory Invitation through Microsoft Graph
我正在使用 Microsoft Graph REST API.
邀请用户作为成员添加到我的 Active Directory
curl -X POST \
https://graph.microsoft.com/v1.0/invitations \
-H 'authorization: Bearer ey...Jg' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"invitedUserEmailAddress": "userInvite@hotmail.com",
"inviteRedirectUrl": "https://example.com/afterInvite",
"sendInvitationMessage": false,
"invitedUserType":"Member"
}'
我确实收到了带有状态字段的正确响应:
"status": "PendingAcceptance",
这当然是真的,因为用户刚刚被邀请。有没有办法查看用户是否已兑换邀请?
非常感谢
Microsoft Graph 不支持检查受邀用户的状态。但是我们可以使用 Azure AD 报告 API 来检查此状态。
为了得到这个状态,我们可以获取Update user事件并检查UserState来达到目的。
有关 Azure AD 报告的更多详细信息 API,您可以 link。
Note:Actions don’t appear immediately in the audit activity log. It can take anywhere from 30 minutes to an hour to see the audit logs in the Azure portal from the time the operation is performed.
Wait for 30 minutes to an hour and see if the actions appear in the activity log.
更新
Azure 现在具有邀请状态
https://docs.microsoft.com/en-us/azure/active-directory/b2b/customize-invitation-api#invitation-status
在 Azure 门户用户配置文件的身份部分下有一个名为 "Source" 的 属性,当用户兑换邀请。但是这个来源 属性 不在从 API.
返回的用户 属性 中
在图表 API here 中找到实现方法的请求,请投票。
我在图表浏览器中找到了它:
https://graph.microsoft.com/v1.0/users?$filter=UserType eq 'Guest'&$filter=mail eq 'xx@yyy.com'&$select=externalUserState
我们不能多次使用过滤器。怎么样
https://graph.microsoft.com/v1.0/users?$filter=mail eq 'usersemail'&$select=externalUserState
这可以使用 ms 图表来完成 API
我正在使用 Microsoft Graph REST API.
邀请用户作为成员添加到我的 Active Directorycurl -X POST \
https://graph.microsoft.com/v1.0/invitations \
-H 'authorization: Bearer ey...Jg' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"invitedUserEmailAddress": "userInvite@hotmail.com",
"inviteRedirectUrl": "https://example.com/afterInvite",
"sendInvitationMessage": false,
"invitedUserType":"Member"
}'
我确实收到了带有状态字段的正确响应:
"status": "PendingAcceptance",
这当然是真的,因为用户刚刚被邀请。有没有办法查看用户是否已兑换邀请?
非常感谢
Microsoft Graph 不支持检查受邀用户的状态。但是我们可以使用 Azure AD 报告 API 来检查此状态。
为了得到这个状态,我们可以获取Update user事件并检查UserState来达到目的。
有关 Azure AD 报告的更多详细信息 API,您可以 link。
Note:Actions don’t appear immediately in the audit activity log. It can take anywhere from 30 minutes to an hour to see the audit logs in the Azure portal from the time the operation is performed.
Wait for 30 minutes to an hour and see if the actions appear in the activity log.
更新 Azure 现在具有邀请状态 https://docs.microsoft.com/en-us/azure/active-directory/b2b/customize-invitation-api#invitation-status
在 Azure 门户用户配置文件的身份部分下有一个名为 "Source" 的 属性,当用户兑换邀请。但是这个来源 属性 不在从 API.
返回的用户 属性 中在图表 API here 中找到实现方法的请求,请投票。
我在图表浏览器中找到了它:
https://graph.microsoft.com/v1.0/users?$filter=UserType eq 'Guest'&$filter=mail eq 'xx@yyy.com'&$select=externalUserState
我们不能多次使用过滤器。怎么样
https://graph.microsoft.com/v1.0/users?$filter=mail eq 'usersemail'&$select=externalUserState
这可以使用 ms 图表来完成 API