Talk About Network

Google





Software > ADSI General > Re: Testing if ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 5319 of 5437
Post > Topic >>

Re: Testing if machine is registered in AD domain

by "Richard Mueller [MVP]" <rlmueller-nospam@[EMAIL PROTECTED] > Jul 8, 2008 at 10:48 AM

"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
--
 




 6 Posts in Topic:
Testing if machine is registered in AD domain
"Rich Armstrong"  2008-07-08 09:55:52 
Re: Testing if machine is registered in AD domain
"Richard Mueller [MV  2008-07-08 10:48:17 
Re: Testing if machine is registered in AD domain
"Rich Armstrong"  2008-07-08 11:42:42 
Re: Testing if machine is registered in AD domain
"Joe Kaplan" &l  2008-07-08 13:05:27 
Re: Testing if machine is registered in AD domain
"Richard Mueller [MV  2008-07-08 13:34:36 
Re: Testing if machine is registered in AD domain
"Rich Armstrong"  2008-07-17 07:57:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 21:09:21 PST 2009.