Unicode Error

Gallagher, Tim (NE) Tim.Gallagher at gd-ais.com
Tue Aug 22 13:44:55 EDT 2006


Hey all I am learning Python and having a fun time doing so.  I have a question for y'all, it has to do with active directory.

 

I want to get the last login for a computer from Active Directory.  I am using the active_directory module and here is my code.

 

[START]

 

import active_directory

 

computer = active_directory.root()

for cpu in computer.search ("cn='Computer_Name'"): 

    print cpu.samAccountName                    ←--- Works find

    print cpu.operatingSystem                   ←--- Works find

    print cpu.lastLogon                         ←--- Getting Error

 

[END]

 

 

I get an error that I am not sure what to do with, the error is TypeError: coercing to Unicode: need string or buffer, instance found in my line Do I have to change the output to meet Unicode formation?

 

Thanks,

-T

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060822/590fe259/attachment.html>


More information about the Python-list mailing list