Addition of userPrincipalName attribute when new account is created
authorLukasz Zalewski <lukas@eecs.qmul.ac.uk>
Sat, 16 Oct 2010 18:51:09 +0000 (19:51 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 19 Oct 2010 09:21:04 +0000 (09:21 +0000)
source4/scripting/python/samba/samdb.py

index a40d10d8070d3a934517226d31b0ba6f7d232466..60dc2fe87ea58e4c5b89ad137024a3d6895faefd 100644 (file)
@@ -274,10 +274,12 @@ member: %s
 
         user_dn = "CN=%s,%s,%s" % (cn, (userou or "CN=Users"), self.domain_dn())
 
+        user_principal_name = "%s@%s" % (username, self.domain_dn().replace("DC=", "").replace(",", "."))
         # The new user record. Note the reliance on the SAMLDB module which
         # fills in the default informations
         ldbmessage = {"dn": user_dn,
                       "sAMAccountName": username,
+                      "userPrincipalName": user_principal_name,
                       "objectClass": "user"}
 
         if surname is not None: