This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # define your query filter | |
| $LDAPfilter = "(samaccountname=*)" | |
| # define the object attributes you want returned | |
| $Attributes = @" | |
| samaccountname | |
| givenname | |
| surname | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<T> Query<T>(string query) where T:new() | |
| { | |
| List<T> res = new List<T>(); | |
| MySqlCommand q = new MySqlCommand(query, this.db); | |
| MySqlDataReader r = q.ExecuteReader(); | |
| while (r.Read()) | |
| { | |
| T t = new T(); | |
| for (int inc = 0; inc < r.FieldCount; inc++) |