Within ArcCatalog or ArcMap there is a Python tool found here:
Then all i do is copy the code from the link I gave above into the python box:
# get a list of connected users.
userList = arcpy.ListUsers("Database Connections/admin.sde")
# get a list of usernames from the list of named tuples returned from ListUsers
userNames = [u.Name for u in userList]
And we don't have very many people on our databases so from here I can usually just write a quick email to the few that are on. I just keep a draft of the generic email I send out, so i can pull it up and send it real quick and not have to retype it every time. The draft email pretty much looks like the one in the link -short and simple: Server maintenance will be performed in 15 minutes. Please log off
And if they don't log off by the time I give them, then they will lose their edits.