It is possible to manage users/groups (AAD) and create automations via Python SDK? My goal is to add email aliases to specific users with Python instead of PS.
Thanks!
It is possible to manage users/groups (AAD) and create automations via Python SDK? My goal is to add email aliases to specific users with Python instead of PS.
Thanks!
We have few classes in Python where we can manage the credentials and set the emails for them.
Usually emails will be as Username, have a look on parameters we have.
credential = DefaultAzureCredential()
blob_client = BlobClient(storage_url, container_name="blob-container-01",
blob_name="sample-blob.txt", credential=credential,
proxies={ "https": "https://username:password@10.10.1.10:1180" }
)
Also below link will help you out with all the functions that can sync with Azure Users and its groups, Setting mail servers, sending mails, adding user to groups etc..
Below are the two functions which are helpful for configuring:
def addLocalUser(username, email):
pwd=getGeneratedPassword()
subprocess.check_call(['synouser', '--add', username.encode('utf8'), pwd.encode('utf8'), email.encode('utf8'), '0', email.encode('utf8'), '0'])
addUserToGroup(username, Settings.SynoGroupName)
logger.debug('Added user.')
return pwd
def addLocalUserAndSendMail(email):
username=email.replace(u'@',Settings.SynoAtSignReplacement)
pwd=addLocalUser(username, email)
sendMail(email, Settings.MailSubject, Settings.MailBody.format(username, pwd))