Deleting a User Account via Conduit

Conduit can delete users as well as create and update them. 

You can delete a user manually in the Edit tab, or by file upload, or via the web service.  For purposes of this article, we will discuss using a CSV file.

Setup

To start we need to make sure that Conduit is allowed to manage the user accounts. If the users are set to Conduit as their authentication source this also means that Conduit can manage those accounts completely. If you are using Conduit to make accounts that are managed through another authentication type (like LDAP) we will need to add some steps to the process. 

If the accounts are set to another authentication type, we need to make them switch to Conduit before the change. If the accounts are already managed by Conduit for authentication you can skip ahead. 

First, make sure that the setting “Update all user accounts” under Conduit > Settings > General in the User section is set to "Yes". This allows Conduit to manage the settings for those accounts. 

Next, In order for Conduit to delete user accounts from Moodle™, the account authentication must be set to Conduit. If the user accounts are set to another authentication you will need to first update the user accounts so their auth field reads as “conduit”. You will need to send a csv file through to update the auth field. In order to change the authentication field, Conduit will need the flag “Update Moodle every sync” checked on for the authentication field under Users in the Mappings tab. You can enable this just for the change run or leave it on always for Conduit to keep control of that field.

Create your auth.csv file based on the headers for the User section in mappings. The only fields you will really need are the action field plus the record identifier field and the authentication type field. You can retrieve these headings by going to Conduit > Settings > Mappings and select the CSV Headers button under the Conduit Users section.

Add the users that you would like to be changed to use Conduit authentication in preparation for deletion. The action column should be set to “update" and the authentication should be set to “conduit”.

Run your auth.csv file by either uploading that file to the Conduit folder via SFTP; or by manually adding it via Conduit > Operations > Upload tab. The file name should be the same as what the system expects for the SFTP upload. 

Deleting accounts

Now that the accounts are managed by Conduit authentication, we can proceed to the deletion. 

In the Conduit > Settings > General in the User section there is a setting for “When external is removed”. This setting tells Conduit what to do in the LMS when a deletion for a user record comes through. The options are:

  • Keep internal: The record is deleted in Conduit and is preserved in the LMS. This is what happens automatically when deleting records that use other authentication methods. 
  • Suspend internal: This deletes the record in Conduit and keeps the record in the LMS but sets the authentication to “nologin” which disables the account. This is useful for record keeping purposes. The suspended account details can still be used in reports but the account is not usable until the suspension is lifted. 
  • Delete internal: Deletes the record in Conduit and the LMS. 

Create your auth.csv file based on the headers for the User section in mappings. The only fields you will really need are the action field plus the record identifier field. You can retrieve these by going to Conduit > Settings > Mappings and select the CSV Headers button.

Add the users that you would like to be deleted. The action column should be set to “delete".

Run your auth.csv file by either uploading that file to the Conduit folder in sftp; or by manually adding it via Conduit > Operations > Upload tab. The file name should be the same as what the system expects for the sftp upload. 

Verify

Check the Conduit Reports > Logs to make sure the process completed without error.

2022-10-26_14_26_00-Conduit-Logs.png

Was this article helpful?
2 out of 2 found this helpful