How To Find Deactivated Accounts On Slack

Rephrased: Slack is a great tool for effective professional communication and teamwork. However, managing users may be challenging, especially when trying to organize and declutter the workspace. One common concern for many administrators is locating deactivated accounts. This blog post provides guidance on identifying these accounts.

What is a Deactivated Account?

A deactivated Slack account is a user account that is no longer active in a workspace. This could be due to a user leaving the organization, or an account being disabled for security reasons. Deactivated accounts cannot sign in, receive, or send messages, but their data and message history are still available for reference.

Locating Deactivated Users

Slack doesn’t directly show deactivated users in your workspace member list. To view deactivated users, you need to follow these steps:

  1. Sign in to your Slack workspace as an admin.
  2. Click on the workspace name in the top left corner.
  3. Select Manage members from the dropdown menu.
  4. Click on Deactivated accounts tab at the top of the page.

Using Slack API to Find Deactivated Accounts

For those who prefer a more technical approach, you can utilize Slack’s API to fetch a list of deactivated users. Use the users.list method and filter out the results based on the ‘deleted’ field. Below is a sample Python script that uses the Slack API to accomplish this:

    <p>import slack</p>
    <p>sc = slack.WebClient('your-slack-token')</p>

    <p>def get_deactivated_users(sc):</p>
    <p>&#160;&#160;&#160;&#160;response = sc.users_list()</p>
    <p>&#160;&#160;&#160;&#160;users = response['members']</p>
    <p>&#160;&#160;&#160;&#160;deactivated_users = [user for user in users if user['deleted'] == True]</p>
    <p>&#160;&#160;&#160;&#160;return deactivated_users</p>

    <p>deactivated_users = get_deactivated_users(sc)</p>

Remember to replace the ‘your-slack-token’ with your workspace’s Slack token.

Reactivating Deactivated Accounts

If you want to reactivate a deactivated account, simply navigate to the Deactivated accounts tab under Manage members, click on the user you want to reactivate, and click Reactivate.

Efficient user management is crucial for maintaining a smooth and productive Slack workspace. Knowing how to locate and manage deactivated accounts can help you ensure that your workspace stays organized and optimized.