使用API​​在Azure AD中创建用户

编程入门 行业动态 更新时间:2024-10-09 07:25:39
本文介绍了使用API​​在Azure AD中创建用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是Azure Active Directory工具的新手.我想自动将用户创建从生产环境自动创建到Azure AD,现在可以手动执行此操作.您能指导我如何建立API连接吗,我尝试了Graph API但未能建立 连接.我能够通过developer.microsoft网站成功获取用户.但是POST无法在此工作.

解决方案

你好 Sethu67 ,

您需要确保在尝试创建用户的azure AD中具有用户创建权限.通常我们的帐户必须有 用户帐户管理员角色或 目录中的全局管理员角色.

您可以找到Grprah API参考来创建用户 这里. Graph API快速入门可以通过示例代码帮助您.另外,如果您的目标是与您的Azure AD一起批量创建多个用户,我建议如果您的用例不需要使用REST API,则建议通过Power Shell进行操作. 请浏览以下链接,了解如何使用Powershell在Azure AD中创建用户.

docs.microsoft/zh-CN/powershell/azure/active-directory/new-user-sample?view=azureadps-2.0 docs.microsoft/zh-cn/powershell/module/azuread/new-azureaduser?view=azureadps-2.0 docs.microsoft/zh-cn/office365/enterprise/powershell/create-user-accounts-with-office-365-powershell

如果您有任何其他疑问,请随时告诉我们,如果此答案对您有帮助,请将其标记为答案,以使社区中的其他人受益.

谢谢.

Hi

I am new to Azure Active Directory tool. I want to automate user creation from my production environment to Azure AD, which is performed manually now. Can you guide me on how to establish a API connection, I have tried Graph API but failing to establish a connection. I was able to successfully GET users through developer.microsoft site. But POST wont work there.

解决方案

HelloSethu67,

You would need to make sure that you have user creation rights in azure AD where you are trying to create users . generally our account must have user account administrator role or global admin role in the directory.

You can find the Grprah API reference to create users here. The Graph API quick-start can help you with sample codes on how to do it . Alternatively if creating multiple users in bulk withi your Azure AD is your goal , I woudl suggest doing it via power shell if using REST API is not a requirement for your use case. Please go through the following links on how to use powershell to create users in Azure AD .

docs.microsoft/en-us/powershell/azure/active-directory/new-user-sample?view=azureadps-2.0 docs.microsoft/en-us/powershell/module/azuread/new-azureaduser?view=azureadps-2.0 docs.microsoft/en-us/office365/enterprise/powershell/create-user-accounts-with-office-365-powershell

In case you have any further queries , feel free to let us know and if this answer helps you , please mark it as answer so that it can benefit others in the community .

Thank you.

更多推荐

使用API​​在Azure AD中创建用户

本文发布于:2023-11-28 11:51:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642287.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户   API   Azure   AD

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!