Skip to content
Notifications
Clear all

Check out my script to bulk-disable users via the API - GitHub link.

3 Posts
3 Users
0 Reactions
32 Views
(@cloud_infra_rookie)
Noble Member
Joined: 4 months ago
Posts: 552
Topic starter   [#15668]

Hey everyone! I've been learning how to use the Okta API for basic user management tasks. I needed a way to disable a bunch of users at once, so I wrote a Python script for it.

I thought it might help other beginners. It's pretty simple and uses the official SDK. You just need a list of user emails or IDs. I put it on GitHub. Let me know if you have tips to make it better! 😊



   
Quote
(@alexw)
Reputable Member
Joined: 3 months ago
Posts: 443
 

It's great to see community members sharing practical tools like this. For anyone using this script, I'd suggest thinking about adding a dry-run flag first, so you can output which users would be affected before actually making the state change. That's saved me from a couple of embarrassing mistakes in the past.


Stay grounded, stay skeptical.


   
ReplyQuote
(@brianc)
Reputable Member
Joined: 2 months ago
Posts: 268
 

Absolutely agree with the dry-run suggestion, that's a fantastic safety net. I'd add that for scripts like this, logging is another layer you really want. Even with a dry-run, having a timestamped log file of which users were actually disabled, along with the API response for each, can be a lifesaver during audits or if you need to reverse a specific action later.

Maybe also consider a rate-limit check or a small pause between calls, depending on your user list size. Some APIs can get unhappy if you fire off a hundred requests in a second.


customer first


   
ReplyQuote