How to get the value of msExchMailboxGuid from Actvie Directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • happybj20008
    New Member
    • Jun 2012
    • 1

    #1

    How to get the value of msExchMailboxGuid from Actvie Directory

    I can get some attributes of an user of Active Directory by python script as follows:
    Code:
    import win32com.client
    
    ldap="SELECT cn, mail From 'LDAP://OU=XXXXXXXX,DC=center,DC=intranet,DC=sinotrans'"
    
    c = win32com.client.Dispatch('ADODB.Connection')
    c.Open('Provider=ADsDSOObject')
    
    rs,rc = c.Execute(ldap)
    rs.MoveFirst()
    while not rs.EOF:
        for e in rs.fields:
            print('{}: {}'.format(e.Name, e.Value))
        print()
        rs.MoveNext()
    But if I add "msExchMailboxG uid" to the SQL query clause, the value of msExchMailboxGu id is always <memory at 0x02298350>.
    It seems msExchMailboxGu id is not a string and how I print its value?
    Any answer are appreciated!
Working...