//搜索域赋予对象DirectorySearcher searchAD = new DirectorySearcher();searchAD.Filter = "(sAMAccountName=" + Environment.UserName + ")";//将实体赋予DirectoryEntryDirectoryEntry userEntity = searchAD.FindOne().GetDirectoryEntry();