Richard
Tue Feb 10 18:06:32 CST 2004
David Myers wrote:
> I guess a better way to describe exactly what I'm looking for is to ask
the following.
> Is there a way to differentiate between users and computers in an NT
Domain using VBScript? I've thought about checking against the primaryGID
or something like that.
Hi,
As you know, you must use the WinNT provider in NT domains. You didn't give
any code, but WinNT can enumerate objects of all classes. The Class property
method indicates whether the object is "user", "group", "computer", etc. You
can filter on any class with the Filter method. Perhaps you are filtering on
users before enumerating. For example, all objects enumerated below a users:
Set objDomain = GetObject("WinNT://MyDomain")
objDomain.Filter = Array("user")
For Each objChild In objDomain
Wscript.Echo objChild.Name & ", class: " & objChild.Class
Next
You could modify the above to filter on "group" or "computer", or even all
three. However, if you comment out the "objDomain.Filter" statement, you
should see all classes (exposed by WinNT). Then, the class method should
indicate which.
--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site -
http://www.rlmueller.net
--