Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import subprocess
- cmd = '/usr/bin/dscl', '.', 'list', '/Users'
- task = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- (out, err) = task.communicate()
- allusers = (out).split()
- nonsyss = []
- syss = ['jssadmin', 'root', 'puppet', 'daemon', 'nobody', 'Guest', 'jenkins']
- for user in allusers:
- if (not user[0] == '_') and (user not in syss):
- nonsyss.append(user)
- print nonsyss
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement