Created
June 6, 2013 22:49
-
-
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…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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