Sahil Malik said:
Isn't WMI an alternative? Why shouldn't it be used?
- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
Following are a number of reasons not to use WMI for this:
1. Speed. WMI wasn't designed for domain account management tasks,
especially for larger domains it tends to be real slow, Win32_UserAccount is
particularly known to affect performance negatively. LDAP based DS where
specially designed to execute such queries real fast.
2. Security. Most domain admins turn off WMI services on DC's, or are
granting access to domain admin only.
3. WMI doesn't have a notion of an AD domain hierarchy and as such is not as
feature rich as AD based DS.
4. Using WMI you have to know the DC to connect to, so it fails if the DC is
not reachable, AD DS automatically finds an alternate DC in the domain if a
connection to the logon DC fails.
5. WMI fails to enumerate other domains in the forest (see 3).
One can say it's an alternative for very small NT4 domains, but as it
doesn't offers any advantage over using the ADSI based "WinNT" provider
interfaces encapsulated by System.DirectoryServices, I would say stick with
DS even for small NT4 domains.
Willy.