"Rich Armstrong" <RichA24@[EMAIL PROTECTED]
> wrote in message
news:D076CE49-DDF8-4096-8257-1ED53934E464@[EMAIL PROTECTED]
> With .NET, what's the quickest, reliable way of determining if the
machine
> on which the process is running is registered in an AD domain? This
seems
> like a simple enough task, but the solution eludes me.
>
> TIA...
As far as I can tell, .NET has no special features for this. I attempt to
bind to the ADSystemInfo object. If this fails, the user/computer are not
authenicated to a domain. However, there is a timeout involved. Another
idea
would be to retrieve the value of the userdomain environment variable and
compare this to the ComputerName property of the wshNetwork object. If
they
match, the user is logged in locally. If they do not match, then
userdomain
is the name of the domain. Instead of the userdomain environment variable
you can use the UserDomain property of the wshNetwork object, which is the
same. You could also attempt to bind to the RootDSE object, but this would
also involve a timeout if a domain is not found.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


|