[python-win32] comObject set Null/None

Jesse Kretschmer jkrets at gmail.com
Tue Feb 22 07:11:48 CET 2011


i wish to unset a com object value.  Specifically in active directory.  I
have been using Tim Golden's active_directory module to connect to a user
object.

I have tried setting the value to '', None, and even chr(0).  I am at a
loss.

example:
import active_directory as AD
userObj=AD.find_user("testuser")
userObj.set('telephoneNumber'='')

Traceback (most recent call last):
File "C:\test.py", line 3, in <module>
  userObj.set(telephoneNumber='')
File "C:\Python26\lib\site-packages\active_directory.py", line 514 in set
  self.com_object.SetInfo()
File "<COMObject LDAP://CN=testuser,CN=Users,DC=myDoman,DC=local>", line 2,
in SetInfo
pywintypes.com_error: (-2147352567, 'Exception occured.', (0, u'Active
Directory', u'The attribute syntax specified to the directory service is
invalid.\r\n', None, 0, -2147016693), None)


How do I delete the attribute value of an active directory user?
Thanks,
jesse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110221/1940db4b/attachment.html>


More information about the python-win32 mailing list