I'm writing a script to pull data from both Active Directory and NT4 Domains. The Active Directory code works just fine, and the NT4 code works great except for one thing. I'm probably just overlooking something, but all of my objects are of class User. Is there a way to tell Groups, Users, and Computers apart
Under Active Directory I'm doing this with the objMember.objectCategory property. I don't think that NT4 Domains support this (at least it gave me an error). The objMember.class is what is returning "User" to me every time
Any advice or assistance is greatly appreciated.

RE: NT Domain: All objects of class User by anonymous

anonymous
Tue Feb 10 14:51:05 CST 2004

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

Thanks
David

Re: NT Domain: All objects of class User by Richard

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