0

I am using pyad module in order to create active directory. I have one issue, I am not able to properly set the UPN suffix to @mycompany.local

Here is the code :

new_user = pyad.adcontainer.ADUser.create("Hugo Test", ou, password="Passw0rd", upn_suffix="@mycompany.local", optional_attributes = {"samaccountname":"htest","userPrincipalName":"htest","givenname":"Hugo","sn":"Test","displayName":"Hugo Test"})

The user is created without any issue, but the UPN suffixes remain empty on my active directory.

Active directory : 2012 Pyad : 0.5.15 ptyhon : 3.5.2

Any idea on what is going wrong ?

Bharel
  • 23,672
  • 5
  • 40
  • 80
Hugo
  • 173
  • 1
  • 1
  • 6

1 Answers1

0

Ok, I will answer to my own question. I solved this by setting the UPN suffix in the userPrincipalName so the code looks like :

new_user = pyad.adcontainer.ADUser.create("Hugo Test", ou, password="Passw0rd", upn_suffix="@mycompany.local", optional_attributes = {"samaccountname":"htest","userPrincipalName":"htest@mycompany.local","givenname":"Hugo","sn":"Test","displayName":"Hugo Test"})
Hugo
  • 173
  • 1
  • 1
  • 6