取AD用户跟OU属性字段名称

取AD用户和OU属性字段名称??????????????????? {??????????????????????? foreach (object p in res.Prope

取AD用户和OU属性字段名称
??????????????????? {
??????????????????????? foreach (object p in res.Properties)
??????????????????????? {
??????????????????????????? Response.Write(((System.DirectoryServices.PropertyValueCollection)(p)).PropertyName.ToString() + "=========/n" + ((System.DirectoryServices.PropertyValueCollection)(p)).Value);
??????????????????????? }
??????????????????? }

??????????????????? Response.Write("---------------------");
??????????????????? if (res.Name.Substring(0, 3) == "OU=")
??????????????????? {
??????????????????????? foreach (object p in res.Properties)
??????????????????????? {
??????????????????????????? Response.Write(((System.DirectoryServices.PropertyValueCollection)(p)).PropertyName.ToString() + "==============/n"+((System.DirectoryServices.PropertyValueCollection)(p)).Value);
??????????????????????? }
??????????????????? }

?

可以得到非常全面的AD属性