def _DumpObject(ob, level = 0):
prefix = " " * level
print "%s%s object: %s" % (prefix, ob.Class, ob.Name)
# Do the directory object thing
try:
dir_ob = ADsGetObject(ob.ADsPath, IID_IDirectoryObject)
except pythoncom.com_error:
dir_ob = None
if dir_ob is not None:
info = dir_ob.GetObjectInformation()
print "%s RDN='%s', ObjectDN='%s'" % (prefix, info.RDN, info.ObjectDN)
# Create a list of names to fetch
names = ["distinguishedName"]
attrs = dir_ob.GetObjectAttributes(names)
for attr in attrs:
for val, typ in attr.Values:
print "%s Attribute '%s' = %s" % (prefix, attr.AttrName, val)
for child in ob:
_DumpObject(child, level+1)
评论列表
文章目录