Hi.
I'm developing a testapplication, retrieving objects of type "Computer"
from out AD server. More than 5000 are listed, and I know lots of these
are set as inactive.
I've seen some code testing if user objects are active or not:
DirectoryEntry de = searcher.FindOne().GetDirectoryEntry();
int UAC =
Convert.ToInt32(de.Properties["userAccountControl"].Value);
bool _DSEnabledAccount = (UAC &
(int)ADS_USER_FLAG.ADS_UF_ACCOUNTDISABLE) != 0;
if (_DSEnabledAccount == true)
lbxGetComputerNamePropValues.Items.Add("Computer active");
else
lbxGetComputerNamePropValues.Items.Add("Computer inactive");
I strongly believe that the value retrieved from userAccountControl is
related to users, not computers... If I run the code above ALL
computers are listed as inactive.
Has anyone coded something around computer objects and checked if the
computer objects are active?
Help is greatly appreciated.
Fritjolf