Re: how to determine if a w2k machine is part of a domain
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 May 2006 11:34:46 -0500
Hi,
I guess you could ues IsMember9.vbs to check if the group "Domain Admins" is
a member of the local Administrators group. By default, this group is added
to the local Administrators group when the computer joins the domain, but it
can be changed. Also, the Administrators group can be renamed.
A better approach would be to attempt to bind to the RootDSE object and trap
the error if this fails.
On Error Resume Next
Set objRootDSE = GetObject("LDAP://RootDSE")
If (Err.Number <> 0) Then
Wscript.Echo "Active Directory domain not found"
Wscript.Quit
End If
On Error GoTo 0
strDNSDomain = objRootDSE.Get("defaultNamingContext")
However, the error is raised if a Domain Controller cannot be contacted
(perhaps the network cable is disconnected), even if the machine has been
joined to the domain. This may still suit your needs.
Otherwise, you might look for a registry setting. Perhaps
HKLM\Software\Microsoft\Ads\Providers\LDAP
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
"Christoph Dommermuth" <christoph.dommermuth@xxxxxxxx> wrote in message
news:uNVeHgpeGHA.4912@xxxxxxxxxxxxxxxxxxxxxxx
Hi OM,
I've found this: http://www.rlmueller.net/Programs/IsMember9.txt
Hope this will help you.
Chris
"OM" <om@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:u8$$LNpeGHA.1812@xxxxxxxxxxxxxxxxxxxxxxx
Thanks
.
- Follow-Ups:
- References:
- how to determine if a w2k machine is part of a domain
- From: OM
- Re: how to determine if a w2k machine is part of a domain
- From: Christoph Dommermuth
- how to determine if a w2k machine is part of a domain
- Prev by Date: Re: copy files between 2 remote computers
- Next by Date: record keystrokes with vbs?
- Previous by thread: Re: how to determine if a w2k machine is part of a domain
- Next by thread: Re: how to determine if a w2k machine is part of a domain
- Index(es):
Relevant Pages
|