Skip to content

Instantly share code, notes, and snippets.

@greeno
Created June 6, 2013 22:49
Show Gist options
  • Save greeno/5725631 to your computer and use it in GitHub Desktop.
Save greeno/5725631 to your computer and use it in GitHub Desktop.
Do you have user accounts automatically created in Confluence? Do most of these users never create content? Are you close to your Confluence license? Then this script is for you! It really just tries to remove EVERYONE from Confluence. The good part is that it fails if the user has content. So it will just remove the readers which is a good thin…
import xmlrpclib
url = "https://your-confluence.awhere"
s = xmlrpclib.ServerProxy(url + "/rpc/xmlrpc")
print "Logging in..."
token = s.confluence2.login("username","*****")
if not token:
print "No Token!!"
allUsers = s.confluence2.getActiveUsers(token,True)
for user in allUsers:
print "Removing user: %s"%user
try:
s.confluence2.removeUser(token,user)
except Exception:
print "Could not remove user: %s"%user
print "Has content!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment