Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User groups

0 views
Skip to first unread message

Clarence Washington Jr.

unread,
Feb 2, 1999, 3:00:00 AM2/2/99
to
First you need to have adsi installed. Then you can use the IsMember property of the group object. Or you can use the groups property of the user object.
 
Set GroupObj = GetObject("WinNT://Domain/Group")
If GroupObj.IsMember("WinNT://Domain/user") = True then
 
The above is slow especially when testing for multiple groups. I have found the following to be more effiecient.
 
Set UserObj = GetObject("WinNT://Domain/User")
Set GroupsObj = UserObj.Groups
For each Group in GroupsObj
Select Case Group.Name
Case "Group1"
    Do something here
Case "Group2"
    Do something here
Case "etc"
    Do something here
End Select
Next
 
Clarence

Check it out..

Http://cwashington.netreach.net

On this site you will find resources for all of your scripting needs. Everything you need to get up and running. Over 100 Sample Scripts, ActiveX controls, reference materials, and technical support via an online discussion lounge.

[ Win32Scripting... automate!! ]

René Grossmann <rene.gr...@jura.ch> wrote in message news:91796915...@romeo.jura.ch...
How can I test the groupe membership for a  user in an NT domain ?

Thank's

René Grossmann

René Grossmann

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
After installing adsi, i tried your exemple, but the script makes an execution error
 
"File or class not found in 'Getobject'
 
does it work on Windows 98 ?
 
Is your syntax correct or may i have to replace Domain, Group, User by existing names ?
 
Thank's
 
René Grossmann
 
 
Clarence Washington Jr. a écrit dans le message ...

Clarence Washington Jr.

unread,
Feb 3, 1999, 3:00:00 AM2/3/99
to
You have to plug in the names appropriate for your environment. i.e. Domain should be replaced with the name of your domain.
 
Clarence
 
 
René Grossmann <rene.gr...@jura.ch> wrote in message news:9180606...@romeo.jura.ch...

René Grossmann

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
Ok ! With multiple domains how can i get the domain name of the one who has authentificate me . The Network objet in Wsh returns an empty string

Manfred Braun

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
Hello All,

has someone found a solution for the empty
domain name with W95/W98??? In my case,
the user is logged on and succesfully validated.

Best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_mbr...@manfred.mannheim-netz.de
Phone : +49-621-37 53 86
(Remove the anti-spam-underscore to mail me!)

"=?iso-8859-1?Q?Ren=E9_Grossmann?=" <rene.gr...@jura.ch> wrote:

>This is a multi-part message in MIME format.
>
>------=_NextPart_000_0013_01BE5040.3FEA47C0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>Ok ! With multiple domains how can i get the domain name of the one who =
>has authentificate me . The Network objet in Wsh returns an empty string =
>
>
>Thank's=20
>
>Ren=E9 Grossmann
> Clarence Washington Jr. a =E9crit dans le message ...
> You have to plug in the names appropriate for your environment. i.e. =


>Domain should be replaced with the name of your domain.

> =20
> Clarence
> =20
> =20
> Ren=E9 Grossmann <rene.gr...@jura.ch> wrote in message =
>news:9180606...@romeo.jura.ch...
> After installing adsi, i tried your exemple, but the script makes an =
>execution error
> =20


> "File or class not found in 'Getobject'

> =20


> does it work on Windows 98 ?

> =20
> Is your syntax correct or may i have to replace Domain, Group, User =
>by existing names ?
> =20
> Thank's=20
> =20
> Ren=E9 Grossmann
> =20
> =20
> Clarence Washington Jr. a =E9crit dans le message ...
> First you need to have adsi installed. Then you can use the =
>IsMember property of the group object. Or you can use the groups =


>property of the user object.

> =20
> Set GroupObj =3D GetObject("WinNT://Domain/Group")
> If GroupObj.IsMember("WinNT://Domain/user") =3D True then
> =20
> The above is slow especially when testing for multiple groups. I =


>have found the following to be more effiecient.

> =20
> Set UserObj =3D GetObject("WinNT://Domain/User")
> Set GroupsObj =3D UserObj.Groups


> For each Group in GroupsObj
> Select Case Group.Name
> Case "Group1"
> Do something here
> Case "Group2"
> Do something here
> Case "etc"
> Do something here
> End Select
> Next

> =20
> Clarence=20

> On this site you will find resources for all of your scripting =
>needs. Everything you need to get up and running. Over 100 Sample =
>Scripts, ActiveX controls, reference materials, and technical support =


>via an online discussion lounge.
>
> [ Win32Scripting... automate!! ]
>

> Ren=E9 Grossmann <rene.gr...@jura.ch> wrote in message =
>news:91796915...@romeo.jura.ch...
> How can I test the groupe membership for a user in an NT domain =
>?
> =20
> Thank's
> =20
> Ren=E9 Grossmann
> =20
>
>
>------=_NextPart_000_0013_01BE5040.3FEA47C0
>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
><HTML>
><HEAD>
>
><META content=3Dtext/html;charset=3Diso-8859-1 =
>http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
>HTML//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"><!DOCTYPE HTML =
>PUBLIC "-//W3C//DTD W3 HTML//EN">
><STYLE></STYLE>
>
><META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT color=3D#000000 size=3D2>Ok ! With multiple domains how can i =
>get the=20
>domain name of the one who has authentificate me . The Network objet in =
>Wsh=20
>returns an empty string </FONT></DIV>
><DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT size=3D2>Thank's </FONT></DIV>
><DIV><FONT size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT size=3D2>Ren&eacute; Grossmann</FONT></DIV>
><BLOCKQUOTE=20
>style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
>5px">
> <DIV>Clarence Washington Jr.<CWAS...@EARTHLINK.NET.NOSPAM> a =
>&eacute;crit=20
> dans le message<E7SZ7C9T#GA....@UPPSSNEWSPUB05.MOSWEST.MSN.NET> =
>...</DIV>
> <DIV><FONT face=3DVerdana size=3D2>You have to plug in the names =
>appropriate for=20
> your environment. i.e. Domain should be replaced with the name of =
>your=20
> domain.</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DVerdana size=3D2>Clarence</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>Ren&eacute; Grossmann &lt;<A=20
> =
>href=3D"mailto:rene.gr...@jura.ch">rene.gr...@jura.ch</A>&gt; =
>wrote in=20
> message <A=20
> =
>href=3D"news:9180606...@romeo.jura.ch">news:9180606...@romeo.ju=
>ra.ch</A>...</DIV>
> <DIV><FONT color=3D#000000 size=3D2>After installing adsi, i tried =
>your exemple,=20
> but the script makes an execution error</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>&quot;File or class not found in =
>'Getobject'</FONT></DIV>
> <DIV><FONT size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>does it work on Windows 98 ?</FONT></DIV>
> <DIV><FONT size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>Is your syntax correct or may i have to replace =
>Domain,=20
> Group, User by existing names ?</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>Thank's </FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>Ren&eacute; Grossmann</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV>&nbsp;</DIV>
> <BLOCKQUOTE=20
> style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
>PADDING-LEFT: 5px">
> <DIV>Clarence Washington Jr.<CWAS...@EARTHLINK.NET.NOSPAM> a=20
> &eacute;crit dans le=20
> message<EQVHGWWT#GA....@UPPSSNEWSPUB04.MOSWEST.MSN.NET> =
>...</DIV>
> <DIV><FONT face=3DVerdana size=3D2>First you need to have adsi =
>installed.=20
> Then you can use the IsMember property of the group object. Or =
>you can=20
> use the groups property of the user object.</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DVerdana size=3D2>Set GroupObj =3D=20
> GetObject(&quot;WinNT://Domain/Group&quot;)</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>If=20
> GroupObj.IsMember(&quot;WinNT://Domain/user&quot;) =3D True=20
> then</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DVerdana size=3D2>The above is slow especially =
>when testing=20
> for multiple groups. I have found the following to be more=20
> effiecient.</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DVerdana size=3D2>Set UserObj =3D=20
> GetObject(&quot;WinNT://Domain/User&quot;)</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>Set GroupsObj =3D=20
> UserObj.Groups</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>For each Group in =
>GroupsObj</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>Select Case =
>Group.Name</FONT></DIV>
> <BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
> <DIV><FONT face=3DVerdana size=3D2>Case =
>&quot;Group1&quot;</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; Do =
>something=20
> here</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>Case =
>&quot;Group2&quot;</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; Do =
>something=20
> here</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>Case =
>&quot;etc&quot;</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; Do =
>something=20
> here</FONT></DIV>
> <DIV><FONT face=3DVerdana size=3D2>End =
>Select</FONT></DIV></BLOCKQUOTE>
> <DIV><FONT face=3DVerdana size=3D2>Next</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DVerdana size=3D2>Clarence<FONT size=3D3>=20
> <P align=3Djustify><SMALL>Check it out..</SMALL></P>
> <P align=3Djustify><SMALL><A=20
> =
>href=3D"http://cwashington.netreach.net">Http://cwashington.netreach.net<=
>/A></SMALL></P>
> <P align=3Djustify><SMALL>On this site you will find resources =
>for all of=20
> your scripting needs. Everything you need to get up and running. =
>Over=20
> 100 Sample Scripts, ActiveX controls, reference materials, and =
>technical=20
> support via an online discussion lounge.</SMALL></P>
> <P align=3Dleft><SMALL>[ <A=20
> =
>href=3D"http://cwashington.netreach.net/Home.asp?Page=3D/site/news.html">=
>Win32Scripting...=20
> automate!!</A> ]</SMALL></P></FONT></FONT></DIV>
> <DIV>Ren&eacute; Grossmann &lt;<A=20
> =
>href=3D"mailto:rene.gr...@jura.ch">rene.gr...@jura.ch</A>&gt;=20
> wrote in message <A=20
> =
>href=3D"news:91796915...@romeo.jura.ch">news:917969150.124659@romeo.=
>jura.ch</A>...</DIV>How=20
> can I test the groupe membership for a&nbsp; user in an NT =
>domain=20
> ?<BR><BR>Thank's<BR><BR>Ren&eacute;=20
>Grossmann<BR><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
>
>------=_NextPart_000_0013_01BE5040.3FEA47C0--
>
>


Ken Cross

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
The solution is to use NT. Basically, there is very little security inherent
in W95/W98.

Ken


Manfred Braun <_mbr...@manfred.mannheim-netz.de> wrote in message
<36c15b41.2313126@m1>...

Manfred Braun

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
Ken,

why do we have a method with W95/98 what will never give
a result??????? They have knowed at design time, that
a W95/98 station will never be a domain member. But
the users log on to the domain too. But which domain they
are validated????

Naturally, my comps management had denied my suppose
to use NT.......

Best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_mbr...@manfred.mannheim-netz.de
Phone : +49-621-37 53 86
(Remove the anti-spam-underscore to mail me!)

David E. Stockbridge

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
>>has someone found a solution for the empty
>>domain name with W95/W98???"

>The solution is to use NT.

"Your Majesty! The people have no bread!"

"Then let them eat cake!"

Dave


Clarence Washington Jr.

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
This message was posted to the discussion lounge on my site. We worked on getting this problem fixed... Finally we got it working. Here is the comment detailing how we got it working.
 

"If you can't use Logon.exe, there is one VERY GOOD THING ABOUT THE LITTLE BLACK DOS BOX!!! WSH won't let you retrieve any NETWORK info because you are not logged on until after the script executes. THERE IS A WORKAROUND!!! This is how I did it (Mistake After Mistake)

1) Set your Security Policies to send a confirmation of Logon.
2) Create a batch file that calls the WSH that you will use to log on.
*** BE SURE THAT IT IS ON THE BOTTOM!! ***
3) When the WSH executes at the bottom of the batch file, it will Parse and debug Before it actually executes. This gives that little DOS box a chance to close and log you on.

If you have to, use the VBS Timer command to delay script execution.

Thanx CW! You helped me a lot"

Hope this helps

It pays to hang out on the Discussion Lounge

Clarence

Check it out..

 
On this site you will find resources for all of your scripting needs.

Everything you need to get up and running. Over 100 Sample
Scripts, ActiveX controls, reference materials, and technical support
via an online discussion lounge.
 
[ Win32Scripting... automate!! ]

Clarence Washington Jr.

unread,
Feb 10, 1999, 3:00:00 AM2/10/99
to
This message was posted to the discussion lounge on my site. We worked on getting this problem fixed... Finally we got it working. Here is the comment detailing how we got it working.
 

"If you can't use Logon.exe, there is one VERY GOOD THING ABOUT THE LITTLE BLACK DOS BOX!!! WSH won't let you retrieve any NETWORK info because you are not logged on until after the script executes. THERE IS A WORKAROUND!!! This is how I did it (Mistake After Mistake)

1) Set your Security Policies to send a confirmation of Logon.
2) Create a batch file that calls the WSH that you will use to log on.
*** BE SURE THAT IT IS ON THE BOTTOM!! ***
3) When the WSH executes at the bottom of the batch file, it will Parse and debug Before it actually executes. This gives that little DOS box a chance to close and log you on.

If you have to, use the VBS Timer command to delay script execution.

Thanx CW! You helped me a lot"

Hope this helps

It pays to hang out on the Discussion Lounge

Clarence

Check it out..

 
On this site you will find resources for all of your scripting needs.

Everything you need to get up and running. Over 100 Sample
Scripts, ActiveX controls, reference materials, and technical support
via an online discussion lounge.
 
[ Win32Scripting... automate!! ]
 

Manfred Braun

unread,
Feb 11, 1999, 3:00:00 AM2/11/99
to
Hello Clarence and All,

interesting to read that all. For some reasons in the company
I am not able to use third party software except I have the source
or a contract to be able to get support. The second is, we (our
users...) will not accept to get the logon notification.

THIRD, and as I wrote before, we have that problem AFTER
the user has logged on and is already validated. We never
run'ed in the problem to get an empty username, we get an
empty domain. So we are not able to get further infos about
the user via ADSI.

Best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_mbr...@manfred.mannheim-netz.de
Phone : +49-621-37 53 86
(Remove the anti-spam-underscore to mail me!)


"Clarence Washington Jr." <cwas...@earthlink.net.nospam> wrote:

>This is a multi-part message in MIME format.
>

>------=_NextPart_000_0030_01BE550E.C09A8DD0


>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>

>This message was posted to the discussion lounge on my site. We worked =
>on getting this problem fixed... Finally we got it working. Here is the =
>comment detailing how we got it working.=20
>
>"If you can't use Logon.exe, there is one VERY GOOD THING ABOUT THE =
>LITTLE BLACK DOS BOX!!! WSH won't let you retrieve any NETWORK info =
>because you are not logged on until after the script executes. THERE IS =
>A WORKAROUND!!! This is how I did it (Mistake After Mistake)=20


>
>1) Set your Security Policies to send a confirmation of Logon.
>2) Create a batch file that calls the WSH that you will use to log on.
>*** BE SURE THAT IT IS ON THE BOTTOM!! ***

>3) When the WSH executes at the bottom of the batch file, it will Parse =
>and debug Before it actually executes. This gives that little DOS box a =
>chance to close and log you on.=20
>
>If you have to, use the VBS Timer command to delay script execution.=20


>
>Thanx CW! You helped me a lot"
>
>Hope this helps
>
>It pays to hang out on the Discussion Lounge
>
>Clarence
>

>On this site you will find resources for all of your scripting needs.


>Everything you need to get up and running. Over 100 Sample

>Scripts, ActiveX controls, reference materials, and technical support

>via an online discussion lounge.
>
>[ Win32Scripting... automate!! ]
>
>
>

>------=_NextPart_000_0030_01BE550E.C09A8DD0


>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
><HTML><HEAD>
><META content=3Dtext/html;charset=3Diso-8859-1 =
>http-equiv=3DContent-Type>

><STYLE></STYLE>
>
><META content=3D'"MSHTML 5.00.0910.1309"' name=3DGENERATOR></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT face=3DVerdana size=3D2>
><DIV><FONT face=3DVerdana size=3D2>This message was posted to the =
>discussion lounge=20
>on my site. We worked on getting this problem fixed... Finally we got it =
>
>working. Here is the comment detailing how we got it working. =


></FONT></DIV>
><DIV>&nbsp;</DIV>
><DIV><FONT face=3DVerdana size=3D2>

><P><EM>&quot;If you can't use Logon.exe, there is one VERY GOOD THING =
>ABOUT THE=20
>LITTLE BLACK DOS BOX!!! WSH won't let you retrieve any NETWORK info =
>because you=20
>are not logged on until after the script executes. THERE IS A =
>WORKAROUND!!! This=20
>is how I did it (Mistake After Mistake) </EM>
><P><EM>1) Set your Security Policies to send a confirmation of =
>Logon.<BR>2)=20
>Create a batch file that calls the WSH that you will use to log =
>on.<BR>*** BE=20
>SURE THAT IT IS ON THE BOTTOM!! ***<BR>3) When the WSH executes at the =
>bottom of=20
>the batch file, it will Parse and debug Before it actually executes. =
>This gives=20
>that little DOS box a chance to close and log you on. </EM>
><P><EM>If you have to, use the VBS Timer command to delay script =
>execution.=20
></EM>
><P><EM>Thanx CW! You helped me a lot&quot;</EM></P>
><P></FONT><FONT face=3DVerdana size=3D2>Hope this helps</FONT></P>
><P><FONT face=3DVerdana size=3D2>It pays to hang out on the <A=20
>href=3D"http://cwashington.netreach.net/discussion_lounge/default.asp">Di=
>scussion=20
>Lounge</A></FONT></P>
><P><FONT face=3DVerdana size=3D2>Clarence</FONT></P>
><P><FONT face=3DVerdana size=3D2>Check it out..</FONT></P></DIV>
><DIV><FONT face=3DVerdana size=3D2><A=20

>/A></FONT></DIV>
><DIV>&nbsp;</DIV>
><DIV><FONT face=3DVerdana size=3D2>On this site you will find resources =
>for all of=20
>your scripting needs.<BR>Everything you need to get up and running. Over =
>100=20
>Sample<BR>Scripts, ActiveX controls, reference materials, and technical=20
>support<BR>via an online discussion lounge.</FONT></DIV>
><DIV>&nbsp;</DIV>
><DIV><FONT face=3DVerdana size=3D2>[ Win32Scripting... automate!! =
>]<BR></FONT></DIV>
><DIV style=3D"FONT: 10pt arial">&nbsp;</DIV></FONT></DIV></BODY></HTML>
>
>------=_NextPart_000_0030_01BE550E.C09A8DD0--
>
>


0 new messages