[PATCH] [Bug 7736] Addition of userPrincipalName attribute when new account is created

Lukasz Zalewski lukas at eecs.qmul.ac.uk
Sat Oct 16 12:51:09 MDT 2010


---
 source4/scripting/python/samba/samdb.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index a40d10d..60dc2fe 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -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:
-- 
1.5.5.6


--------------010203070901020308040904--


More information about the samba-technical mailing list