读书人

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

发布时间: 2013-09-14 13:03:22 作者: rapoo

取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属性

读书人网 >操作系统

热点推荐