摘要: 通过LDAP查找AD User所属的ADGroupy1///<summary>2///获得用户所属组的SID3///</summary>4///<code>ComesFromhttp://netwenchao.cnblogs.com</code>5///<returns></returns>6publicstaticIEnumerable<string>GetGroupSidsOfUser(stringuserLoginName,ADOperatoroperater)7{8using(DirectorySear 阅读全文
posted @ 2012-05-25 16:16 David Dong 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 通过LDAP查找出来的结果的Properties中经常会包含byte[]类型的SId,并不是我们在AD中看到的s-x-x-形式的。通过以下函数将其转换。1///<summary>2///转换ByteSidtostring3///</summary>4///<paramname="sidBinary"></param>5///<returns></returns>6publicstaticstringConvertBinarySid2String(byte[]sidBinary)7{8SecurityId 阅读全文
posted @ 2012-05-25 16:06 David Dong 阅读(652) 评论(0) 推荐(0) 编辑