使用API​​在Azure AD中创建用户 [英] Using API to create user in Azure AD

查看:154
本文介绍了使用API​​在Azure AD中创建用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

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

https://docs.microsoft.com/zh-CN/powershell/azure/active-directory/new-user-sample?view=azureadps-2.0
https://docs.microsoft.com/zh-cn/powershell/module/azuread/new-azureaduser?view=azureadps-2.0
https://docs.microsoft.com/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.

解决方案

Hello Sethu67,

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 . 

https://docs.microsoft.com/en-us/powershell/azure/active-directory/new-user-sample?view=azureadps-2.0
https://docs.microsoft.com/en-us/powershell/module/azuread/new-azureaduser?view=azureadps-2.0
https://docs.microsoft.com/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中创建用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆