On 03/10/2012 22:50, Matt LaPlante wrote:
> user = 'mrunicode'
> dnc =
> win32com.adsi.ADsGetObject('LDAP://rootDSE').Get('DefaultNamingContext')
> ado = win32com.client.Dispatch('ADODB.Connection')
> ado.Open('Provider=ADsDSOObject')
> lfilter = '(&(sAMAccountName=%s)(objectCategory=User))' % user
> search = '<LDAP://%s>;%s;adsPath;subtree' % (dnc, lfilter)
> obj_record = ado.Execute(search)[0]
> print obj_record.Fields('adsPath'))

print obj_record.Field("ADsPath").Value

which doesn't attempt to do an implicit encode on the string

TJG
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to