
Checking for NT Domain Group Membership
Hi Ian,
I have been unable to get your code translated to jscript. Looking
over past posts to the jscript newsgroup, it seems I'm not the only one
struggling with this problem. Translating "Prop In adsobj.groups" or
"Prop In adsobj.groups()" to jscript just doesn't work for me.
Anyway, what do you think of the following as an alternative? Would
there likely be any performance problems as compared to IsMember?
var ADsPath = "WinNT://domain/username";
var userobj = GetObject(ADsPath);
for(var e=new Enumerator(userobj.Groups()); !e.atEnd(); e.moveNext())
{
var group = e.item();
switch (group.Name)
{ // *********** Edit Below this point
*****************
case 'IT':
// etc....
--Blake
Quote:
> How have you found the performance of IsMember?
> With ADSI 2.1 it was VERY slow.
> Regards,
> Ian
> WSH FAQ http://wsh.glazier.co.nz
> > Thank you for your response which indicates a technique I hadn't
thought
> > of. After some research, I had come up with a different approach
which
> > also uses ADSI:
> > grp = GetObject("WinNT://domain/groupname");
> > if ( grp.IsMember("WinNT://domain/username") ) {...}
> > Regards,
> > Blake
> > > If you install ADSI on every workstation you can use the
following
> > code in
> > > your logon script...
> > > adsPath = "WinNT://" & strDomain & "/" & strUser
> > > set adsObj = GetObject(adsPath)
> > > For Each Prop In adsobj.groups
> > > Select Case Prop.Name
> > > Case "Domain Admins"
> > > Call Administrators()
> > > Case "Group1"
> > > Call Group1()
> > > Case "Group2"
> > > Call Group2()
> > > 'etc
> > > End Select
> > > Next 'Prop
> > > Regards,
> > > Ian
> > > WSH FAQ http://wsh.glazier.co.nz
Quote:
> > > > Use ADSI.
> > > > Cheers,
> > > > Nick.
> > > > -----Original Message-----
> > > > Posted At: 26 October 1999 03:11
> > > > Posted To: microsoft.public.scripting.wsh
> > > > Conversation: Checking for NT Domain Group Membership
> > > > Subject: Checking for NT Domain Group Membership
> > > > I'm writing a login script in which I want to check for NT
domain
> > group
> > > > membership. So far, I haven't found a simple way to do this.
Could
> > > > someone help? Thanks in advance.
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
Sent via Deja.com http://www.deja.com/
Before you buy.