c# - System.DirectoryServices.Protocol search question -


I'm trying to write a search from System.DirectoryServices.Protocol from System.DirectoryServices

In SDS I get back all the requested properties, but in SDSP, I do not get a GUID or a Homephone ...

The rest of the work works for a user.

Any thoughts? Public Stable List & lt; AllAdStudentsCV & gt; GetUsersDistinguishedName (string domain, string specific name) {{Network credential credentials = new network credentials (Configuration Manager. AppSettings ["AD_User"], Configuration Manager. AppSettings ["AD_Pass"]); LdapDirectoryIdentifier directoryindexifier = new LdapDirectoryIdentifier (domain + ": 389"); (Using LdapConnection Connection = New LdapConnection (Directory Identifier, Credentials)) {SearchRequest searchRequest = New SearchRequest (); SearchRequest.DistinguishedName = Prominent name; SearchRequest.Filter = "(and (object category = person) (object class = user) (SN = Afran))"; // "(and (object class = user))"; SearchRequest.Scope = SearchScope.Subtree; SearchRequest.Attributes.Add ("name"); SearchRequest.Attributes.Add ("sAMAccountName"); SearchRequest.Attributes.Add ("uid"); SearchRequest.Attributes.Add ("telexNumber"); // studId searchRequest.Attributes.Add ("Homephone"); // ctrId searchRequest.SizeLimit = Int32.MaxValue; SearchRequest.TimeLimit = New TimeSpain (0, 0, 45, 0); // 45 minutes - EWB Search Response Search. Response = connection.SendRequest (searchRequest) as SearchResponse; If (searchResponse == faucet) return tap; & Lt; AllAdStudentsCV & gt; User = new list & lt; AllAdStudentsCV & gt; (); FirstHatch (Entry Entry entry in Search Engineer Search) {AlledStudentCV User = New AllStudentCV (); the user. Active = "y"; User.CenterName = ""; User.StudId = GetstringAttributeValue (Entry Property, "TelexNumber"); User.CtrId = GetstringAttributeValue (Entry Properties, "Homephone"); User.Guid = GetstringAttributeValue (Entry Properties, "UID"); User.Username = GetstringAttributeValue (Entry Property, "sAMAccountName"); Users.Add (user); } Users return; }} Hold (Exception Pre) {Throw; Besides, if I want to get every user in the advertisement, then I can integrate the data with my SQL DB, how can I do this, I have exceeded the maximum size, I remove errors. I set size to maxInt32 ... is there an "undiscovered size" option?

thanks,

Eric -

I think That's the standard way to use the system. Directory Service, Not System.DirectoryServices.ProtocolWhy do you want users later?

Regarding your second question about the error message "exceeded the maximum size," you may try to get several entries at once.
In order to avoid surrendering the limits of the Active Directory, the standard way of bringing all the users using the paging search is the number of items returned from the query (something like the limit 1000 objects).

The algorithm is like this:

  1. You create a query that will bring to all users
  2. Specify specific control (paged result control) which indicates that this is a paged search, with 500 users per page
  3. you launch the query, get the first page and parse
  4. The first 500 entries in that page
  5. The sector asks Eddie to parse the next 500 entries
  6. Repeat until you are no pages are not left

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -