active directory users
-
Sorry, I don't quite understand what it is you want, but I found this article[^] here on codeproject which seems to deal a lot with the active directory, should have something about what you are trying to get information on. If not, try any of the following hits: 1[^] 2[^] Sorry I couldn't be of more help. Edit: Some more links on codeproject about querying / interacting with the AD; First Link - deals with querying the AD[^] Second Link - deals with authentication[^] Third Link - More querying AD[^] Let me know how it goes.
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
modified on Tuesday, June 23, 2009 5:09 PM
-
Sorry, I don't quite understand what it is you want, but I found this article[^] here on codeproject which seems to deal a lot with the active directory, should have something about what you are trying to get information on. If not, try any of the following hits: 1[^] 2[^] Sorry I couldn't be of more help. Edit: Some more links on codeproject about querying / interacting with the AD; First Link - deals with querying the AD[^] Second Link - deals with authentication[^] Third Link - More querying AD[^] Let me know how it goes.
Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
modified on Tuesday, June 23, 2009 5:09 PM
i tried this method to see if i could figure out if the user was disabled but i get and error i just wanted to see if i would get a 0x1 if the user account is not disbled and a 0x2 if it was public void Disable(string userDn) { try { DirectoryEntry user = new DirectoryEntry(userDn); int val = (int)user.Properties["userAccountControl"].Value; \\ get the error on the above line user.Properties["userAccountControl"].Value = val | 0x2; //ADS_UF_ACCOUNTDISABLE; } catch (System.DirectoryServices.DirectoryServicesCOMException E) { //DoSomethingWith --> E.Message.ToString(); } }
-
i tried this method to see if i could figure out if the user was disabled but i get and error i just wanted to see if i would get a 0x1 if the user account is not disbled and a 0x2 if it was public void Disable(string userDn) { try { DirectoryEntry user = new DirectoryEntry(userDn); int val = (int)user.Properties["userAccountControl"].Value; \\ get the error on the above line user.Properties["userAccountControl"].Value = val | 0x2; //ADS_UF_ACCOUNTDISABLE; } catch (System.DirectoryServices.DirectoryServicesCOMException E) { //DoSomethingWith --> E.Message.ToString(); } }
This is what I use passing in the DirectoryEntry object as a paramater.
public static bool CheckAccountDisabled(DirectoryEntry de)
{
int ACCOUNTDISABLE = 0x0002;
int flags = (int)de.Properties["userAccountControl"].Value;
if (((flags & ACCOUNTDISABLE) == ACCOUNTDISABLE))
{
return true;
}
return false;
}modified on Thursday, June 25, 2009 6:02 PM