zakird / pyad

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

Cannot retrieve objectSid attribute #115

Open doubley612 opened 5 years ago

doubley612 commented 5 years ago

When executing the following: user = aduser.ADUser.from_cn("abc", search_base="domain.com") user.get_attribute("objectsid")

I'm getting: [<memory at 0x000001AB96AB6108>]

How can I get the actual SID of the object?

seanwlk commented 5 years ago

ADObject class has an attribute sid so there is no need to use get_attribute()

The value of the attribute you are currently getting it's in bytes, you have to convert it and there is a function for this in the library that it's called convert_sid.