简体   繁体   English

将用户从 SQL Server 表移动到 Active Directory

[英]Moving users from SQL Server table to Active Directory

I have a table in my SQL Server database which stores the users who have access to my application.我的 SQL Server 数据库中有一个表,用于存储有权访问我的应用程序的用户。 Now, I want to move these users to an AD group.现在,我想将这些用户移动到 AD 组。

One option is to create a hangfire job and move these users to AD group using LDAP queries.一种选择是创建 hangfire 作业并使用 LDAP 查询将这些用户移动到 AD 组。 However, there are very less instances of new users being added.但是,添加新用户的实例非常少。

Is there any way of moving a newly created user to AD group through SQL only?有没有办法仅通过 SQL 将新创建的用户移动到 AD 组? I'm trying to find a way of not using the hangfire job.我试图找到一种不使用 hangfire 工作的方法。 Is this even possible?这甚至可能吗?

Not sure about hangfire job, but SQL is not a good choice for your requirements.不确定 hangfire 工作,但 SQL 不是满足您要求的好选择。 Since SQL is only applicable for RDBMS query, transferring users from SQL server database to Azure AD isn't sound realistic.由于 SQL 仅适用于 RDBMS 查询,因此将用户从 SQL 服务器数据库转移到 Azure AD 听起来不太现实。 I recommend you the standard approach for that.我建议您使用标准方法。

You can use PowerShell to add member to Azure AD group.可以使用 PowerShell 将成员添加到 Azure AD 组。

Add-AzureADGroupMember 
   -ObjectId <String> 
   -RefObjectId <String> 
   [-InformationAction <ActionPreference>] 
   [-InformationVariable <String>] 
   [<CommonParameters>]

Refer: https://docs.microsoft.com/en-us/powershell/module/azuread/add-azureadgroupmember?view=azureadps-2.0参考: https : //docs.microsoft.com/en-us/powershell/module/azuread/add-azureadgroupmember?view=azureadps-2.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM