简体   繁体   中英

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. Now, I want to move these users to an AD group.

One option is to create a hangfire job and move these users to AD group using LDAP queries. 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? I'm trying to find a way of not using the hangfire job. Is this even possible?

Not sure about hangfire job, but SQL is not a good choice for your requirements. Since SQL is only applicable for RDBMS query, transferring users from SQL server database to Azure AD isn't sound realistic. I recommend you the standard approach for that.

You can use PowerShell to add member to Azure AD group.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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