scripts/moduser

22 lines
424 B
Text
Raw Normal View History

#!/usr/bin/python3
import sys
import os
# Determine if running in interactive mode
interactive = len(sys.argv) == 1
# Get user details
if interactive:
username = input('Enter username: ')
else:
username = sys.argv[1]
2021-08-20 21:34:00 +00:00
if username == 'Manager':
2021-08-20 22:03:44 +00:00
bind_user = 'cn=Manager,dc=exozy,dc=me'
2021-08-20 21:34:00 +00:00
else:
2021-08-20 22:03:44 +00:00
bind_user = 'uid=' + username + ',ou=People,dc=exozy,dc=me'
# Modify user
os.system('ldapvi --user ' + bind_user)