zakird / pyad

Python Active Directory Tools | *Not actively maintained*
http://zakird.github.io/pyad/
176 stars 72 forks source link

Can't get aduser from_cn with special character: 'There is no such object on the server.\r\n' #85

Closed josephwong13 closed 5 years ago

josephwong13 commented 5 years ago

When I try executing the follow code:

userName = "ABC*DEF"
user = aduser.ADUser.from_cn(userName)

I get the following error: pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Active Directory', 'There is no such object on the server.\r\n', None, 0, -2147016656), None)

is there any workaround for this issue? As everything else is working for me and I don't want to give up using this library for this single issue

stevenpitts commented 5 years ago

What are you looking to do? Are you trying to use as a wildcard and get ABCBOBDEF, ABCFOODEF, ABCBARDEF, etc? Or do you have a user named "ABCDEF"?

josephwong13 commented 5 years ago

Hi Makusu, thanks for your reply. I was trying to map a user with a * literal in their name. But I ended up using the ldap library for some other reason. So this issue could be closed.