@Falco and all, this is something that I would like to be able to do on the forum that I help run.
We have one category for “Members Only” - that is restricted to only our paid/active members - that I am able to import a list of users who currently have active accounts in our Active Directory through the Web Interface; however, there is no easy way to do a bulk remove of members who are no longer active from the group using the Web Interface.
I do have access to the server side and one of our admins already has a script to export the active accounts to a CSV file that includes the e-mail addresses of all currently active members; however, I do not know how to create a script that would remove all members from the restricted group on our forum, then add only the currently active members back to it (which sounds like basically what you are doing…). This is something that I would like to have done daily, as mentioned in the post quoted above.
I think that what you want to do is have your developer use API calls to update Discourse when changes are made to the accounts rather than export a CSV daily. I’ve written one for the Wordpress MemberMouse plugin (I think that’s what it was).
Failing that, you might want a list of users to delete and a list of those to add, and then do something to check that both lists are actually in sync.
The reason we export the CVS daily is because we do not have our forum tied directly into our AD accounts. It was setup like that to allow anyone to register for an account on our forum. Even though we do not have our discourse instance tied into Active Directory authentication, will the API be able to pull the information from AD? (I was previously advised by some who do most of the developing for our forum that it would be best to have the active accounts exported from AD, then imported into the custom group… I am open to other options though.).
Hi @Selk68@pfaffman Hi, I am looking for a solution to remove bulk users. I understand this can be done by scripting. Can you please share more details on how to run the script on the platform? Or this is something that can be done by a developer only.
Also, I read about AD. Can you please share how it works and how we can sync AD with Discourse?
If AD means windows active directory, i would avoid it unless you are already deeply committed to it. I think there might be some thing that will let you use it as sso, but you’d have to pay me lots I money to find out about it.